8.14.2. Performing Maintenance on a Master

Maintenance, including MySQL admin or schema updates, should not be performed directly on a master as this may upset the replication and therefore availability and functionality of the slaves which are reading from the master.

To effectively make the modifications, you should switch the master host, then operate on the master as if it were slave, removing it from the replicator service configuration. This helps to minimize any problems or availability that might be cause by performing operations directly on the master.

The complete sequence and commands required to perform maintenance on an active master are shown in the table below. The table assumes a dataservice with three datasources:

Step Description Command host1 host2 host3
1 Initial state   Master Slave Slave
2 Switch master to host2 See Section 8.12, “Switching Master Hosts” Slave Master Slave
3 Put slave into OFFLINE state trepctl -host host1 offline Offline Master Slave
4 Perform maintenance   Offline Master Slave
5 Validate the host1 server configuration tpm validate Offline Master Slave
6 Put the slave online trepctl -host host1 online Slave Master Slave
7 Ensure the slave has caught up trepctl -host host1 status Slave Master Slave
8 Switch master back to host1 See Section 8.12, “Switching Master Hosts” Master Slave Slave