Manually Switching the Primary and Secondary Nodes of a Replica Set

Scenarios

A replica set consists of the primary node, secondary node, and hidden node. Primary and secondary nodes allow access from external services by providing IP addresses. Hidden nodes are only used for backing up data. When a primary node becomes faulty, the system automatically selects a new primary node to ensure high availability. In addition, DDS supports the primary/secondary switchover so you can perform switchovers in scenarios such as disaster recovery.

Note

  • You can perform a switchover when the DB instance status is Available, or Changing a security group.

  • The database connection may be interrupted during the switchover. Ensure that your client supports reconnection.

  • The longer the delay for primary/secondary synchronization, the more time is needed for a primary/secondary switchover. Therefore, if the primary to secondary synchronization delay exceeds 300s, the primary/secondary switchover is not allowed. For details about the synchronization delay, see What Is the Time Delay for Primary/Secondary Synchronization in a Replica Set?

Procedure

  1. Log in to the DDS console.

  2. On the Instance Management page, click the target replica set instance.

  3. In the Node Information area on the Basic Information page, click Switch.

  4. In the displayed dialog box, click Yes.

  5. Check the result.