Help Center> GaussDB(for MySQL)> User Guide> Read Replicas> Promoting a Read Replica to the Primary Node
Updated on 2023-10-18 GMT+08:00

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

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page, choose Database > GaussDB(for MySQL).
  4. On the Instances page, click the instance name to go to the Basic Information page.
  5. In the Node List area, locate the read replica to be promoted and click Promote to Primary in the Operation column.
  6. 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:

  1. Read replicas available for promotion are identified.
  2. One or more read replicas with the highest priority are identified.
  3. 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.