Verify MySQL Master/Slave Replication

  21 Aug 2014

This script could be handy to verify your MySQL Master/Slave Replication setup

It is highly recommended to use ~/.ssh/config (Rather than using Shell Aliases because it will widely work with many programs, for instance scp, mosh, ssh-copy-id and more) So, you would have:

Host data-server-master
    IdentityFile ~/.ssh/<yourprivatekey>
    User boo
    HostName <master host IP>

Host data-server-slave
    IdentityFile ~/.ssh/<yourprivatekey>
    User boo
    HostName <slave host IP>

And, on both servers in boo user home directory. Just create ~/.my.cnf file (if it does not exist yet), fill in this content and modify the user and password part:

password = DBPASSWORD
host = localhost

Download curl -O And chmod +x Then, ./

Mine I got:

Master Position: 8253491 -> Slave Position: 8253491

You might see similar output as above but in different positions.

comments powered by Disqus