Promoting a Read Replica to Primary
A GaussDB(for MySQL) 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 project.
- Click in the upper left corner of the page and choose Databases > GaussDB(for MySQL).
- On the Instances page, click the instance name to go to the Basic Information page.
- In the Node List area, locate the read replica to be promoted and click Promote to Primary in the Operation column.
Figure 1 Promoting a read replica to the new primary node
- In the displayed dialog box, click Yes.
- During a manual switchover, there may be a brief disconnection lasting about 30 seconds. Ensure that your applications support automatic reconnection.
- During a manual switchover, the DB instance status is Promoting to primary and this process takes several seconds or minutes.
- After a switchover is complete, the node types of the original primary node and read replica have been exchanged, and the read replica status changes to Available.
- A read replica whose failover priority is -1 cannot be promoted to the primary node.
- Services may be intermittently interrupted for several seconds or minutes when a read replica is promoted to the primary node.
- Promoting a read replica to primary will switch over the private IP addresses for read of the primary node and read replica. To ensure workloads are not interrupted, connect to your DB instance using the private IP address from the Network Information area in the Basic Information page or the proxy address from the Database Proxy page. For details about the differences between the two addresses, see Description of Each IP Address.
- To ensure workload continuity, enable Application Lossless and Transparent (ALT) before promoting a read replica to primary.
Automatic Failover
GaussDB(for MySQL) uses an active-active HA architecture that automatically fails over to a read replica selected by the system.
Each read replica has a failover priority that determines which read replica is promoted if the primary node fails.
- Priorities range from 1 for the highest priority to 16 for the lowest 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:
- Read replicas available for promotion are identified.
- One or more read replicas with the highest priority are identified.
- One of the read replicas with the highest priority is selected and promoted. If the promotion fails due to network faults or abnormal replication status, GaussDB(for MySQL) attempts to promote another read replica by priority and repeats the process until a read replica is successfully promoted.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot