rail’d

Fight the framework! 
« Back to blog

There are other ways you could use Monit to keep an eye on your MySQL replication processes, but this one is simple and involves no external dependencies:

check file mysql-slave with path /var/lib/mysql/master.info
  if timestamp > 5 minutes then alert

If the slave process stops, then the master.info file doesn't get updated with changing binlog positions and Monit will send an alert.  Obviously this depends on MySQL's implementation, and isn't as decoupled as a 'SHOW SLAVE STATUS' solution, but it's a lot simpler.

MySQL seems to update the binlog every few minutes if the slave is running.  If you need quicker alerts, this method isn't for you!

Loading mentions Retweet

Comments (1)

Jun 30, 2009
Andy Triggs said...
Note that if your master DB is inactive for the specified duration, then you'll get alerts too. In this case, either this method isn't for you, or you can increase the timestamp age appropriately.

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    Connect    twitter