Sql DB replication check


#1

Hi all,
anybody got an idea how to check if a DB is replicating?
I have a distributed MySQL DB (one master 6 slaves) and would like to check if the replication is working…
My idea was to use a dummy record with a timestamp updated every 10 minutes on the master and then checking on the slaves if this timestamp is within 10 minutes… any better ideas?

Thx for your comments.

Luca


#2

Go for it.
Just modify to suit and execute from command line.

more /usr/local/system.scripts/chkmysqlstatus.sh
#!/bin/sh

#This script will check the master/slave status of tia3407 and alpha

echo “Output of show master status”
/usr/bin/mysql -pyourpassword -e "show master status"
echo ""
echo “Output of show slave status”
/usr/bin/mysql -pyourpassword -hremotehostnameip -e “show slave status”

The last line, you can dupe for each of your slaves with the appropriate slave ip/hostname/whatever.


#3

Thanks. …never thought of checking THAT…
“why easy if you can have it difficult?” :smiley:

Luca