-1

Got some trouble with a VPS where MySQL dies on me from time to time. As a temporarily fix I've installed Monit to make sure that the process is restarted when it dies. I checked the site today and it was down due to Database error, so MySQL had died on me again. I checked Monit it it said "Execution failed".

My configuration looks like this

check process mysqld with pidfile /var/run/mysqld/mysqld.pid
        start program = "/etc/init.d/mysql start"
        stop program = "/etc/init.d/mysql stop"
        if failed host 127.0.0.1 port 3306 type tcp then restart
        if 5 restarts within 5 cycles then timeout
        if 5 restarts within 5 cycles then alert

I'm running Ubuntu 12.04.3 LTS

enter image description here

INT
  • 121
  • 4
  • And your question is? Also, did you try to restart MySQL manually to see if that works or shows some meaningful error messages? What do the log files say? – Sven Dec 29 '14 at 19:26

1 Answers1

0

Monit is only there to try to watch the process. In this case, MySQL failed, Monit attempted to restart it... Unfortunately, Monit was not able to start the process. However, it did its job by alerting you.

Running /etc/init.d/mysql start at the command line likely results in an error. That's your starting point to try to repair your DB.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • What state makes Monit think there was an error ? Is Monit pinging too early after the restart ? I'm asking because my MySQL is uo but Monit still displays `Execution failed` on the MySQL line. – Stephane Jan 10 '16 at 21:37