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
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.
~/.my.cnf file (if it does not exist yet), fill in this content and modify the user and password part:
[client] user = DBUSERNAME password = DBPASSWORD host = localhost
curl -O https://gist.githubusercontent.com/zdk/2b76b84309221b2ade08/raw/d9ef0e1d8d3b13625b9539464a8186792ab836f5/verify_mysql_repl.sh
chmod +x verify_mysql_repl.sh
Mine I got:
Master Position: 8253491 -> Slave Position: 8253491
You might see similar output as above but in different positions.