Promoting a Read Replica to the Primary Node
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 a project.
- Click in the upper left corner of the page, choose .
- 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.
- On the displayed dialog box, click Yes.
- During the manual switchover, there may be a brief disconnection lasting about 30 seconds. Ensure that your applications support automatic reconnection.
- During a manual switchover, the instance status is Promoting to primary and this process takes several seconds or minutes.
- After the 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.
- 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 the services are not interrupted, use the private IP address from the Network Information area to connect to an instance.
Automatic Failover
GaussDB(for MySQL) uses a high availability active-active architecture that automatically fails over to a new primary node automatically 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.