Can we monitor M-S data consistency by using pt-table-checksum through shell script

Hello Team,

I am planning to monitor the M-S replication data consistency by using pt-table-checksum and send the report to mail … Here for HA if we are using maxscale , how we can do this ? becasue whenever it is prompt M-S , S-M , how we can monitor ?

Pls guide me

pt-table-checksum should be ran directly to the source, not through maxscale. You will need to write a wrapper script to run pt-t-c, then check the exit code ($?). If not 0, then there are differences, then the script should send an email. You will need to have an email relay server setup on whichever server is executing pt-t-c and you will also need to have replica monitoring configured within pt-t-c correctly.

Hi @matthewb

We have replication setup with Master - Slave , and max scale setup to monitor and promte as a master from slave , from slave to master …Monitor is in place …
Now i want to run this script in maxscale server based on the current master status , the script will run and check the pt-t-c utility and sent mail notification .

Do you have sample script on this ?

I do not. This is something custom to everyone. You simply need to write a ~10-20 line bash script to ask maxscale who the current master is, and then run pt-t-c against that master and send an email if the exit code is not 0.