MySQL Replication fix after server shutdown/start

Posted by Jagbir on Server Fault See other posts from Server Fault or by Jagbir
Published on 2013-11-07T08:13:03Z Indexed on 2013/11/07 9:57 UTC
Read the original article Hit count: 187

Filed under:
|
|

Server1 is Master

Server2 is Slave

Both are in our AWS testing env and we stop them once done with our work. When start again, Master rotates/creates new binary log file but slave keep looking for same/existing one and replication stops. Right now, I'm manually repairing it by (slave):

stop slave; 
CHANGE MASTER TO MASTER_HOST='xx', MASTER_USER='xxx', MASTER_PASSWORD='xxx' , MASTER_LOG_FILE='new-mysql-bin.00000x',MASTER_LOG_POS=107;
start slave;
show slave status\G

and slave becomes good again.Mysql is 5.5.x on Ubuntu 12.04. Will appreciate any help in automating it.

© Server Fault or respective owner

Related posts about mysql

Related posts about database