Managing streaming replication
You need to have a plan for the objectives for each individual server in the cluster. Which standby server will be the failover target?
How to do it…
Switchover is a controlled switch from the primary to the standby. If performed correctly, there will be no data loss. To be safe, simply shut down the primary node cleanly, using either the
fast shutdown modes. Do not use the
immediate mode shutdown because you will almost certainly lose data that way.
Failover is a forced switch from the primary node to a standby because of the loss of the primary. So, in that case, there is no action to perform on the primary; we presume it is not there anymore.
Next, we need to promote one of the standby nodes to be the new primary. A standby...