MySQL Forums
Forum List  »  Replication

Re: replication monitoring
Posted by: James Bromberger
Date: March 21, 2005 01:43PM

Try my replicaiton check, developed to run under Nagios:

Configure the replication user on your master to be on your slave as well, and give it the right permissions (as in the --help). Then start the script with --slave --slave-pass and it connects to the slave (use --slave-port if required). It reads the status, determines the position, and also the address and port of the master. It then connects to the master server with the same credentials, does a SHOW MASTER STATUS, and compares the differences.

Output is like:

OK: 0.000 diff 5 secs, (4.1.7-standard-log) -> (4.1.7-standard-log)

A newer option I have added is for the script to look at the databases that are being replicated, and then do a SHOW TABLE STATUS on one of these (randomly selected) and do the same on the master, and then check they have a similar number of rows. This is a rough check that not only is replication working, but the table sizes are approximately the same. NOTE: InnoDB does (wildly random) approximations of rows in SHOW TABLE STATUS, so these table types are ignored.

Hope this helps.

Options: ReplyQuote

Written By
February 23, 2005 09:59AM
February 24, 2005 08:03AM
Re: replication monitoring
March 21, 2005 01:43PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.