Manually Switching Between Primary and Standby DB Instances
Scenarios
If the primary node of a primary/standby instance is unavailable due to a VM, disk, or network fault, RDS automatically triggers a primary/standby failover. In addition to automatic failover, you can manually switch between the primary and standby instances for rack-level DR.
Introduction to Primary/Standby DB Instances
A primary/standby instance uses an HA architecture. The primary and standby instances share the same IP address.
- Data is synchronized from the primary instance to the standby instance in real time. You can only access the primary instance. The standby instance serves as a backup.
- When a primary instance is being created, a standby instance is provisioned along with it to provide data redundancy. The standby instance is invisible to you after being created.
- If the primary instance fails, a failover occurs, during which database connection is interrupted. If there is a replication delay between the primary and standby instances, the failover takes an extended period of time. The client needs to be able to reconnect to the instance.
Constraints
- A manual switchover does not change the connection information of the DB instance, including its VPC, subnet, security group, floating IP address, private domain name, and database port.
- A primary/standby switchover may cause a brief interruption of several seconds or minutes (depending on the replication delay). If transaction logs are generated at a speed higher than 30 MB/s, services will probably be interrupted for several minutes. To prevent traffic congestion, perform a switchover during off-peak hours.
- You can perform a switchover only when the following conditions are met:
- The primary/standby instance is running properly.
- The primary/standby replication is normal.
- The replication delay is less than 5 minutes, and the data on the primary and standby instances is consistent.
Procedure
- Log in to the management console.
- Click
in the upper left corner of the page and choose Databases > Relational Database Service. - On the Instances page, click the target primary/standby instance name to go to the Overview page.
- Under DB Instance Type, click Switch.
- In the displayed dialog box, click Yes.
- After the switchover is successful, check the status of the DB instance on the Instances page.
- During the switchover, the DB instance status is Switchover in progress.
- In the upper right corner of the DB instance list, click
to refresh the list. After the switchover is successful, the DB instance status will become Available.