gpt4 book ai didi

mysql - Monit 进程 'mysql' 未被监控

转载 作者:IT王子 更新时间:2023-10-29 00:35:08 25 4
gpt4 key购买 nike

知道为什么 monit 不会在此设置中监视 mysql 吗???我已尽我所能在这里找到解决问题的所有方法,但均无济于事。

这些是我的版本:

Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
mysql --version
Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (x86_64) using readline 6.3
monit -V
This is Monit version 5.6

我已经尝试过这两种设置:

check process mysql with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
#if failed host 127.0.0.1 port 3306 protocol mysql then restart
if failed unixsocket /var/run/mysqld/mysqld.sock protocol MYSQL then restart

得到这个:

monit status
Process 'mysql'
status Not monitored
monitoring status Not monitored

可以确认:

/var/run/mysqld/mysqld.pid

读起来和

一样

ps -e | grep“mysql”

日志:

/var/log/monit.log

没有显示错误

Monit 以 root 身份运行:

ps -eaf | grep monit
root 4549 1 0 05:18 ? 00:00:00 /usr/bin/monit -c /etc/monit/monitrc
root 5248 12440 0 05:53 pts/0 00:00:00 grep --color=auto monit

最佳答案

如前所述,应该这样做:

monit monitor mysql

有时“超时”语句可以在重启错误太多的情况下禁用监控,我不建议使用这样的语句:

if X restarts within Y cycles then timeout

关于mysql - Monit 进程 'mysql' 未被监控,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29006613/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com