I am still pretty newbie to mysql. This question is regarding promoting slave with option –log-slave-updates to become a master.
The typical schema of promoting slave to master was described in 15.3.6 Switching Masters During Failover. Here you can find very strict steps how to do it :
Run your slaves with the –log-bin option and without –log-slave-updates. The reason for running the slave without –log-slave-updates is to prevent slaves from receiving updates twice in case you cause one of the slaves to become the new master.
Let's say I have the schema like the following (the image was taken from 15.3.5. Improving Replication Performance).
Where Master 2 is actually a slave with –log-slave-updates and bin-log enabled. I need to enable –log-slave-update in order to save bin-log from the Master 1 to bin-log of Master 2 and then transfer it to all slave. In case of failover I need promote Master 2 to the role of Master 1. But there is a contradiction to the standard MySql failover schema I have –log-slave-updates enabled which can cause a problem.
In your opinion. What the action I should take in order to do this?
Best Answer
The warning about
--log-slave-updates
will only apply if you had multiple intermediary 'Master/Slave' servers.The warning is this (my emphasis):
But in your scenario,
Slave 2
is not changing masters, it will still point to the sameMaster 2
server it always was at.So now, in case of
Master 1
failing, you will need to do two things:Master 2
Master 2
--log-slave-updates
on the newMaster 2