What is the best practice for monitoring a slave to make sure that it is
a) Still running
b) Not too far being the master
I would like to alert by email if it is behind, happy to write a script or two to hook into command line applications.
monitoringMySQLmysql-replication
What is the best practice for monitoring a slave to make sure that it is
a) Still running
b) Not too far being the master
I would like to alert by email if it is behind, happy to write a script or two to hook into command line applications.
Best Answer
1
you can use maatkit's mk-heartbeat
2
you can look at result of
run on sql slave but Seconds_Behind_Master is disturbingly inaccurate at times.
3
you can hack your own solution, similar to mine - i use it both for nagios monitoring and for feeding munin charts showing 'seconds behind master'.
on master server i have simple cron job:
where repltest is:
on the slave i monitor value returned by:
local time on all servers is synchronized via ntp.
repl_test db contains:
if you run replication - i suggest you also set up mk-table-checksum to compare content of your sql servers from time to time.