0

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.

Lakshya
  • 29
  • 1
  • 6

1 Answers1

0

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

nacho
  • 5,280
  • 2
  • 25
  • 34
  • I tried doing the same, didnt work. Do I have to use CHANGE MASTER TO MASTER_HOST="slave host instance" on the master server's instance ? – Lakshya Oct 03 '17 at 10:04
  • No, you should do it on the Slave instance like this CHANGE MASTER TO MASTER_HOST='masters_instance',MASTER_USER='master_user',MASTER_PASSWORD='master_password',MASTER_PORT=3306, MASTER_CONNECT_RETRY=30;. You need to have the slave stopped (stop slave), run the command and then start slave – nacho Oct 03 '17 at 10:11
  • I read your question again, and i can tell you that the data from the SLAVE never updates to the MASTER as you say. It's the data from the MASTER that replicates to the SLAVE. That maybe is the reason it doesn't work – nacho Oct 03 '17 at 10:15
  • So is there no way to update the data(when the Master was down) from Slave to the Master? – Lakshya Oct 03 '17 at 10:29