forked from docs/doc-exports
Reviewed-by: Wagner, Fabian <fabian.wagner@t-systems.com> Co-authored-by: Ru, Li Yi <liyiru7@huawei.com> Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
5.3 KiB
5.3 KiB
Promoting a Read Replica to the Primary Node
A GaussDB(for MySQL) DB instance consists of a primary node and multiple read replicas. In addition to automatic failover scenarios, you can perform a manual switchover to promote a read replica to the new primary node.
Manual Switchover
- Log in to the management console.
- Click
in the upper left corner and select a region and a project.
- Click Service List. Under Databases, click GaussDB(for MySQL).
- On the Instances page, click the target DB instance.
- At the bottom of the Basic Information page, locate the read replica to be promoted and click Promote to Primary in the Operation column.
- In the displayed dialog box, click Yes.
- During the manual switchover, an intermittent disconnection may occur for about 30 seconds. Ensure that your applications support automatic reconnection.
- During the manual switchover, the instance status is Promoting to primary and this process takes several seconds or minutes.
- After the switchover is complete, the node running status changes to Available. The node types of the original primary node and read replica have been exchanged.
Automatic Failover
GaussDB(for MySQL) uses an active-active high availability architecture and can automatically fail over to a new primary node that is automatically selected by the system.
Each read replica has a failover priority that determines the order in which it is promoted when recovering from a primary node failure.
- Priorities range from 1 for the first priority to 16 for the last priority.
- If two or more read replicas share the same priority, they have a same probability of being promoted to the new primary node.
GaussDB(for MySQL) selects a read replica and promotes it to the new primary node as follows:
- Find all read replicas that are available for a promotion.
- Find one or more read replicas with the highest priority.
- If the promotion fails due to network faults or abnormal replication status, GaussDB(for MySQL) attempts to promote another read replica by priority until the promotion is successful.
Parent topic: Read Replicas