Digital Ocean has a tutorial about it, which also includes an example on how to keep MySQL running. The short synopsis is:
- Install monit
sudo apt-get install monit
- Edit the configuration file:
sudo nano /etc/monit/monitrc
and include the following in it:check process mysqld with pidfile /var/run/mysqld/mysqld.pid start program = "/etc/init.d/mysql start" stop program = "/etc/init.d/mysql stop"
- Reload the new configuration:
monit reload
I strongly suggest you look at the MySQL error log to understand why it is stopping (it should not do this in normal operation). It would be a good idea to also run mysqlrepair to check the status of all tables as you might have some serious DB corruption.
Không có nhận xét nào:
Đăng nhận xét