Skip to content

zhi200-com/AutoRestartMySQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoRestartMySQL

monitor and restart mysql process

Our Website: https://zhi200.com/

Author Email: opensource@zhi200.com

Config

Generate Configuration File: cp config.ini.cf config.ini

config.ini File Configuration

[main]
name=AutoRestartMySQL       # Service name, used to distinguish different servers during message notifications

[mysql]
interval=60            # Check interval
host=127.0.0.1          # The IP address of MySQL
port=3306             # The Port of MySQL
restart=service mysql restart  # MySQL restart command

[notify]
channels=zhimessenger_1,dingtalk_robot_1,wechat_webhook_1       # channels for message notifications, separated by a semicolon

[zhimessenger_1]
type=zhimessenger               # message notifications type: zhimessenger / dingtalk_robot / wechat_webhook
key=                     # message notifications key

Run

Install Dependencies: pip install -r requirements.txt

Run: python ./autorestartmysql.py

Autorun

AlmaLinux

sudo vim /etc/rc.d/rc.local

Add as follows:

cd /[path]/AutoRestartMySQL/src && nohup python ./autorestartmysql.py &

CentOS

sudo vim /etc/rc.local

Add as follows:

cd /[path]/AutoRestartMySQL/src && nohup python ./autorestartmysql.py &

About

monitor and restart mysql process

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages