This topic describes how to switch over services between the primary and read-only nodes of an ApsaraDB for PolarDB cluster. Each PolarDB cluster consists of one primary node and one or more read-only nodes. The system can automatically switch over services from the primary mode to a read-only node. Alternatively, you can perform a manual switchover by specifying a read-only node as the new primary node. A manual switchover is used to verify high availability or when you require a specific read-only node to serve as primary.
Manually switch over services between primary and read-only nodes
- Log on to the ApsaraDB for PolarDB console.
- In the upper-left corner of the ApsaraDB for PolarDB console, select the region where the cluster resides.
- Find the target PolarDB cluster and click the cluster ID.
- In the Node Information page, click Switch Primary Node.
- In the dialog box that appears, select the read-only node that you want to promote
as primary from the New Primary Node drop-down list, and click Confirm.
Note If you do not select a read-only node from the New Primary Node drop-down list, the system promotes the read-only node with the highest failover priority as primary. There may be a 30-second transient disconnection during the switchover. Make sure that you application can automatically reconnect to the PolarDB cluster.
Automatically switch over services between primary and read-only nodes
ApsaraDB for PolarDB uses an active-active high-availability cluster architecture. This architecture allows for automatic failovers between primary and read-only nodes.
Each node in an ApsaraDB for PolarDB cluster has a failover priority, which determines the probability that the system promotes this node as primary in the event of a failover. If multiple nodes have the same failover priority, they all have the same probability of being promoted as the primary node.
- Find all read-only nodes that can be promoted as primary.
- Select one or more read-only nodes that have the highest failover priority.
- If the failover to the selected read-only node fails due to exceptions such as network or replication faults, another read-only node is promoted as the primary node based on its failover priority until the failover succeeds.
|FailoverDBCluster||Manually switches over services from the primary node to a specified read-only node in an ApsaraDB for PolarDB cluster.|