ApsaraDB for Redis supports automatic failovers from the master node to the replica node. You can also manually switch workloads from the master node to the replica node. This allows you to perform real-time disaster recovery drills. You can switch the node roles of the instance that is deployed across multiple zones based on your business deployment. This way, your applications can connect to the nearest nodes.
- After a switchover of master and replica nodes is performed, the data nodes may change to the read-only state and become disconnected for a few seconds. Make sure that your applications are configured to automatically reconnect to the instance.
- After an instance enters the Switching state, you cannot manage this instance. For example, you cannot modify the instance configurations or migrate the instance to another zone.
In this scenario, the ECS instance where the application is deployed resides in Zone B. The master node of the ApsaraDB for Redis instance is deployed in Zone A. The ECS instance needs to connect to the master node across zones. This increases the network latency and may affect the performance of the ApsaraDB for Redis instance and your business operation.
To optimize the architecture for deploying cloud resources, you can switch the roles of nodes. In this example, you can change the role of the node in Zone B to master node. Only the node roles are changed. The ECS and ApsaraDB for Redis instances can be connected in the same zone without changing the zones where the ApsaraDB for Redis instance is deployed and the instance ID. This minimizes network latency.
- Log on to the ApsaraDB for Redis console.
- On the top of the page, select the region where the instance is deployed.
- On the Instance List page, click the Instance ID of the instance.
- In the left-side navigation pane, click Service Availability.
- In the Zone Distribution section, select the data node that requires the switchover and click Switchover.Note You can view the distribution of the roles of data nodes in the zone on this page.
- In the panel that appears, select the time when you want to perform the switchover.
- Immediate: performs the switchover immediately.
- Maintenance Window: performs the switchover within the specified maintenance window. For more information about how to view and modify a maintenance window, see Set the maintenance window.
- Click OK.
Related API operations
|SwitchInstanceHA||Performs the master-replica switchover to switch node roles. This feature can be applied to disaster recovery drills and nearby access to applications that are deployed across zones.|
ApsaraDB for Redis can monitor the health status of nodes. If a master node in an instance becomes unavailable, ApsaraDB for Redis automatically triggers a master-replica switchover. The roles of master and replica nodes are switched over to ensure high availability of the instance. For more information, see Causes and impacts of master-replica switchovers.