Database Replication Failure
After an OS upgrade, a database replication process may fail. As result, if the master goes down, the slave node will not be able to become the master.
To detect if a database replication has failed, follow this process.
On the master node, run the following command:
Sample output in a healthy cluster.
- In a cluster where replication is not happening, you will not see any rows being displayed.
On the master node, execute the following steps:
Tail the log file and look for replication slot name
You will see lines similar to the following code block.
Create a replication slot manually by using the following command:
(replace the name of the replication slot if needed based on the output seen in the log file)
After about 10-15 seconds, run the following command on the master node to verify replication is working:
Replication on the Master Node
Each time there is a fail over, the replication slot must be created on the new master node:
If a master node goes down which results in a fail over, the failed node must be brought back up as the new slave node by the admin to make the cluster healthy again.
In addition, after the failed node is restored to healthy state, be sure to verify and fix the replication slot in the master node by using the above procedure.
- No labels