All Products
Search
Document Center

Tair:Manually switch workloads from a master node to a replica node

Last Updated:Sep 18, 2023

This topic describes how to switch workloads from a master node to a replica node. In addition to automatic switchovers, Tair allows you to manually switch workloads from a master node to a replica node. Manual switchovers can help you perform disaster recovery drills and verify the error processing capabilities of clients. If your Tair instance is deployed in multiple zones, you can also perform a manual switchover to allow applications to connect to the nearest node.

Prerequisites

The instance uses the master-replica deployment model.

Note

A master-replica switchover is not supported for instances that use the standalone deployment model.

Impacts

  • The data nodes on which the switchover is performed are disconnected for a few seconds. A switchover has potential data loss risks. For example, the data may become inconsistent between the master and replica nodes due to synchronization latency. To prevent potential data loss risks caused by the switchover and data doublewrite caused by the Domain Name System (DNS) cache, the data nodes become read-only for up to 30 seconds.

  • 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.

Scenarios

In the following example, the Elastic Compute Service (ECS) instance on which your applications are deployed resides in Zone B, and the master node of the Tair instance resides in Zone A. The connection between the ECS instance and the master node of the Tair instance spans different zones. This increases network latency. This also affects the performance of the Tair instance and your business.

To optimize the deployment architecture of cloud resources, you can switch your workloads from the master node to the replica node to minimize network latency. After the manual switchover, the original replica node is promoted to become the new master node. The manual switchover does not cause changes to the zones and IDs of the master node and replica node.

可用区就近连接示例

Procedure

  1. Log on to the Tair console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.

  2. In the left-side navigation pane, click Service Availability.

  3. In the Data Node section, select the data shard for which you want to perform a switchover and click Switchover.

    Note

    If the instance is a cluster instance, you can view the information about the zones in which the master and replica nodes of each data shard reside.

  4. 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 the maintenance window of a Tair instance, see Set a maintenance window.

  5. Click OK.

    Warning If you change the VPC or vSwitch of an instance, the instance encounters transient connections for 30 seconds. Make sure that you change the VPC or vSwitch during off-peak hours and your applications can automatically reconnect to the instance.

Related operations

Operation

Description

SwitchInstanceHA

Manually switches workloads from a master node to a replica node. This operation can be used for disaster recovery drills. This operation can also be used for nearby connections between your applications and a Tair instance if the instance is deployed in multiple zones.

References

Tair can monitor the health status of nodes. If a master node in an instance fails, Tair automatically triggers a master-replica switchover. For example, the roles of master and replica nodes are switched over to ensure the high availability of the instance. For more information, see Master-replica switchovers.