How to update master database with data of slave database after failover in mysql

966 views Asked by At

I'm using Mysql Server 5.6. I've setup master-slave replication and its working fine. The only problem is, when i get the master server up the data from the slave is not updated automatically to the master.

1

There are 1 answers

4
nacho On

What you need to do to shutdown your Master correctly is:

  1. In your SLAVE node --> STOP SLAVE;
  2. Shutdown SLAVE node
  3. Shutdown your Master node

For starting your system again:

  1. Start your Master
  2. Start your SLAVE node
  3. In your SLAVE node --> START SLAVE;

EDITED When you use a DB replica, it is suposed to copy from your MASTER instance to your SLAVE instance, never the other way. You shouldn't be updating your replica (SLAVE) when your MASTER get's down.

You may need to read this Mysql Switching Master to configure your system so you can make a Slave as new Master once your old Master gets down