We have a master percona server (10.0.0.1) in the primary data center. We also have a slave percona server (10.0.0.2) in the secondary data center that follows the master (10.0.0.1). [This slave will become the master in near future.]
In the near future, we will move our secondary data center to our primary data center. The current master (10.0.0.1) will be shut down and the current slave (10.0.0.2) will take its place to become the new master server. In effect, we just need to change the DATABASE_IP_ADDRESS
in our application after migration. Before that change, I set up another slave (10.0.0.3) that follows 10.0.0.2 (current slave and future master).
Everything works but the problem is that 10.0.0.3 does not follow 10.0.0.2.
The commands are:
MySQL-slave-1> CHANGE MASTER TO MASTER_HOST='10.0.0.1', MASTER_USER='repl', MASTER_PASSWORD='somePAS$', MASTER_LOG_FILE='mysql-bin.000159', MASTER_LOG_POS=6334000543;
MySQL-slave-2> CHANGE MASTER TO MASTER_HOST='10.0.0.2', MASTER_USER='repl', MASTER_PASSWORD='somePAS$', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=143;
This is called "Master with Relay Slave" replication and finally I found the solution here!