MyBase Redis supports primary-replica switchover to ensure high availability. When a primary instance becomes unavailable, a replica instance is promoted to the new primary instance. This topic describes how to perform a manual primary-replica switchover.
Background
- Automatic switchover: By default, automatic switchover is enabled for MyBase Redis instances. If a primary instance fails or becomes inaccessible, a replica instance is automatically promoted to the new primary instance.
- Manual switchover: You can perform a manual primary-replica switchover at any time, even when automatic switchover is enabled. Manual switchovers are useful for tasks such as disaster recovery drills or optimizing connection latency in deployments that span multiple availability zones.
Precautions
A transient disconnection occurs during the switchover. Ensure that your application has an automatic reconnection mechanism.
Procedure
- Log on to the ApsaraDB for MyBase console.
- In the upper-left corner of the page, select the target region.
- Find the target dedicated cluster and click Details in the Details column.
- In the navigation pane on the left, click Instances. The switchover procedure depends on the architecture type of your instance.
- Scenario 1: For an instance with a primary-replica (non-cluster) architecture, find the target instance. In the Actions column, click the .
- Scenario 2: For an instance with a cluster architecture, click Host Details in the Host column. Find the target shard. In the Actions column, click the .
- In the panel that appears, select a switchover mode and click OK.
The Switchover Mode parameter has the following options:
- Switch Immediately: Forces an immediate switchover of the instance.
- Switch Within Maintenance Window: Waits for all primary instances on the current host to switch over to replica instances on other hosts before switching your selected instance. This helps minimize service disruptions.
该文章对您有帮助吗?