Tips and Tricks

It is important to wait for the old master to catch up with the new master in order to guaranty that no transactions are lost. Depending on the time the old master was down or not accessible it might take a considerable time for the old master to execute all missing transactions. MySQL Utilities provide tools that allow the visualizations of the slaves status, namely the 'health' command of the mysqlrpladmin utility.

An alternative set of steps could have been followed to perform the desired task, using the failover command from mysqlrpladmin instead of switchover. In this case, the old master should be specified in the candidates list using the option --candidates to be chosen as the preferred slave to become the new master (no need for the --master, --new-master and --demote-master options). However, an additional step will be required to set the previous master (server2:3312) as a slave of the old master (server1:3311) using the mysqlreplicate utility, because failover will not demote the previous master as it assumes that it is not available. Notice that unlike switchover that will fail if the server specified by the --new-master option does not meet the requirements to become master, failover will chose another server from the slaves list to become the new master if the one specified in by the --candidates option is not suitable. It is important to keep this behavior differences in mind when deciding which command to apply.

User Comments
Sign Up Login You must be logged in to post a comment.