Database Replication and Clustering
8.14.3. Performing Maintenance on an Entire Dataservice | ||
---|---|---|
Prev | 8.14. Performing Database or OS Maintenance | Next |
To perform maintenance on all of the machines within a replicator service, a rolling sequence of maintenance must be performed carefully on each machine in a structured way. In brief, the sequence is as follows
Perform maintenance on each of the current slaves
Switch the master to one of the already maintained slaves
Perform maintenance on the old master (now in slave state)
Switch the old master back to be the master again
A more detailed sequence of steps, including the status of each datasource in the dataservice, and the commands to be performed, is shown in the table below. The table assumes a three-node dataservice (one master, two slaves), but the same principles can be applied to any master/slave dataservice:
Step | Description | Command | host1 | host2 | host3 |
---|---|---|---|---|---|
1 | Initial state | Master | Slave | Slave | |
2 |
Set the slave host2
offline
| trepctl -host host2 offline | Master | Offline | Slave |
3 | Perform maintenance | Master | Offline | Slave | |
4 |
Validate the host2 server
configuration
| tpm validate | Master | Offline | Slave |
5 |
Set slave host2 online
| trepctl -host host2 online | Master | Slave | Slave |
6 |
Ensure the slave (host2 )
has caught up
| trepctl -host host2 status | Master | Slave | Slave |
7 |
Set the slave host3
offline
| trepctl -host host3 offline | Master | Slave | Offline |
8 | Perform maintenance | Master | Slave | Offline | |
9 |
Validate the host3 server
configuration
| tpm validate | Master | Slave | Offline |
10 |
Set the slave host3 online
| trepctl -host host3 online | Master | Slave | Slave |
11 |
Ensure the slave (host3 )
has caught up
| trepctl -host host3 status | Master | Slave | Slave |
12 |
Switch master to host2
| See Section 8.12, “Switching Master Hosts” | Slave | Master | Slave |
13 |
Set the slave host1
| trepctl -host host1 offline | Offline | Master | Slave |
14 | Perform maintenance | Offline | Master | Slave | |
15 |
Validate the host1 server
configuration
| tpm validate | Offline | Master | Slave |
16 |
Set the slave host1 online
| trepctl -host host3 online | Slave | Master | Slave |
17 |
Ensure the slave (host1 )
has caught up
| trepctl -host host1 status | Master | Slave | Slave |
18 |
Switch master back to
host1
| See Section 8.12, “Switching Master Hosts” | Master | Slave | Slave |