There's a couple ways to go about this. The simplest thing (and what we use in most of our simple monitoring cases) is a shell script that checks the output of "show slave status\G" on the slave periodically. If it reports that either thread isn't running, or there's something in "Last error", or the time behind master is too long, it throws an error and alerts us in our monitoring software. We do something similar for non-replication checking... we parse the output of "mysqladmin status".
Slightly more complicated (and also probably more accurate- the time reported by show slave status is known to be unreliable in some cases) would be a script that inserts a row into a table, then check the slave over and over till it arrives. Or even better, insert 2 values... a timestamp that *you* provide (in a shell script, something like $(date) would work) and a timestamp generated by MySQL.... assuming the times are syncronized on the master, slave, and the box you're inserting from, when the insert hits the slave it'll generate it's own timestamp, which you can then subtract *your* timestamp from. There's also a tool in maatkit which does replication tracking, although I've not yet used it. Judging by the other tools in that package though, it's probably pretty decent :). Jake On Mon, Dec 22, 2008 at 8:26 PM, xufeng <xuf...@yuanjie.net> wrote: > Hello everyone, > In my production system, I set up MySQL 5.0.67 master/slave replication, and > recently I met with master/slave replication lag problem. > Is there a good monitoring tool or some other tools to detect and discover > this latency on slave? > Any suggestion is welcomed. > Thank you in advance. > > Yours, > Xu Feng > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=jakem...@gmail.com > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org