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:
Switch master to ||See Section 8.12, “Switching Master Hosts”||Slave||Master||Slave|
|3||Put slave into OFFLINE state||trepctl -host host1 offline||Offline||Master||Slave|
Validate the ||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|
Switch master back to
||See Section 8.12, “Switching Master Hosts”||Master||Slave||Slave|