A PolarDB Cluster Edition cluster consists of multiple nodes. One of the nodes is a primary node and the other nodes are read-only nodes. The system can automatically switch over services from the primary node to a read-only node in the event of a system failure. Alternatively, you can perform a manual switchover by specifying a read-only node as a new primary node. For example, if you need to test the high availability of a cluster or specify a read-only node as a primary node, you can perform a manual switchover.
Limits
Only PolarDB Cluster Edition supports the primary/secondary switchover feature. Single Node and Archive Database do not support the primary/secondary switchover feature. For more information about feature comparison among the editions, see Product editions.
Manually switch over services between primary and read-only nodes
Automatically switch over services between primary and read-only nodes
PolarDB uses an active-active high-availability cluster architecture. This architecture supports automatic failovers between the primary node that supports reads and writes and the read-only nodes. The system automatically elects a new primary node.
Each node in a PolarDB cluster has a failover priority. This priority determines the probability at which a node is elected as the primary node during a failover. If multiple nodes have the same failover priority, they all have the same probability of being elected as the primary node.
- Find all the read-only nodes that can be elected as the primary node.
- Select one or more read-only nodes that have the highest failover priority.
- If the failover to the first node fails due to reasons, such as network issues and abnormal replication status, the system tries to switch to another node until the failover succeeds.
Related API operations
API | Description |
---|---|
FailoverDBCluster | Manually switches over services between the primary node and a read-only node in a PolarDB cluster. You can specify a read-only node as the new primary node. |