1 Star 1 Fork 0

zhi200-com/AutoRestartMySQL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

AutoRestartMySQL

监控MySQL进程,并自动重启。

项目官网地址:https://zhi200.com/

作者邮箱:opensource@zhi200.com

配置

生成配置文件:cp config.ini.cf config.ini

config.ini文件配置

[main]
name=AutoRestartMySQL       # 服务名称,用于消息通知时区分不同服务器

[mysql]
interval=60            # 检查时间间隔
host=127.0.0.1          # MySQL的IP地址
port=3306             # MySQL的端口
restart=service mysql restart  # MySQL重启命令

[notify]
channels=zhimessenger_1,dingtalk_robot_1,wechat_webhook_1       # 通知频道列表,以半角逗号分隔

[zhimessenger_1]
type=zhimessenger               # 通知类型: 支持 zhimessenger(信鸽通知) / dingtalk_robot(钉钉机器人) / wechat_webhook(微信群机器人)
key=                     # 通知密钥

运行

安装依赖项:pip install -r requirements.txt

运行:python ./autorestartmysql.py

开机自启

AlmaLinux

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

加入如下行:

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

CentOS

sudo vim /etc/rc.local

加入如下行:

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

MIT License Copyright (c) 2023 zhi200-com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

monitor and restart mysql process 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/zhi200-com/AutoRestartMySQL.git
git@gitee.com:zhi200-com/AutoRestartMySQL.git
zhi200-com
AutoRestartMySQL
AutoRestartMySQL
main

搜索帮助