Cross-zone automatic switchover

更新时间:
复制 MD 格式

PolarDB supports cross-zone automatic switchover.

Overview

After you enable cross-zone automatic switchover for a PolarDB cluster, if the primary availability zone fails (for example, if all compute nodes in the primary availability zone fail simultaneously), the cluster automatically switches over to the secondary availability zone. The secondary database is then promoted to the new primary database to restore cluster availability.

In addition, PolarDB provides a semi-synchronous mode for cross-zone data replication. This mode reduces the Recovery Point Objective (RPO) of an automatic switchover and significantly lowers the risk of data loss. For more information, see Semi-synchronous replication based on physical replication (Semi-sync).

Prerequisites

  • The cross-zone automatic switchover feature is available only for PolarDB for MySQL Cluster Edition.

  • You must enable the hot standby feature when you purchase the cluster.

  • The billing method of the cluster must be pay-as-you-go or subscription.

Limitations

  • RPO and RTO

    • In asynchronous mode, cross-zone automatic switchover is a lossy switchover. The RPO is less than 100 ms in most cases and less than 60 seconds in a worst-case scenario. Evaluate the potential impact before you use this feature.

    • In asynchronous mode, the Recovery Time Objective (RTO) is less than 30 seconds.

  • Your cluster's region must have PolarDB resources deployed in at least two availability zones. The following regions do not support multi-availability zone deployment: Philippines (Manila), South Korea (Seoul), China (Qingdao), China (Chengdu), China (Hohhot), and Thailand (Bangkok).

Benefits

Switchover in seconds

With cross-zone automatic switchover enabled, if the primary availability zone fails, the cluster can switch over to the secondary availability zone in seconds, ensuring high availability.

Billing

The cross-zone automatic switchover feature is currently available free of charge.

Procedure

Enable cross-zone automatic switchover

  1. Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the cluster's region, and then click the cluster ID to open its details page.

  2. On the Basic Information page, click Enable to the right of Cross-zone Automatic Switchover.

  3. In the dialog box that appears, click OK.

  4. (Optional) Enable semi-synchronous mode for cross-zone data replication.

    Note

    The main differences between semi-synchronous mode and asynchronous mode are as follows. For more information, see Semi-synchronous replication (Semi-sync).

    • Semi-synchronous mode: When a transaction is committed, the system returns a success message only after the redo logs for the transaction are persisted on the backup node in the secondary availability zone.

    • Asynchronous mode: When a transaction is committed, the system returns a success message as soon as the redo logs are persisted on the primary read-write (RW) node. It does not wait for the logs to be persisted on the backup node in the secondary availability zone.

    1. Click Modify Data Replication Method.

    2. In the dialog box that appears, select Semi-synchronous and click OK.

Switch back to the original primary zone

After the original primary availability zone recovers from a failure, you can manually switch the cluster back by clicking Switch to Original Primary Zone or Change the primary availability zone.

Note
  • After an automatic switchover, network traffic crosses availability zones, which may increase latency. We recommend switching the cluster back to the original primary availability zone after it recovers.

  • If you click Switch to Original Primary Zone, the original vSwitch is used.

  • If you click Change the primary availability zone, you can select a different vSwitch.

Switch to original primary zone

  1. Log on to the PolarDB console.

  2. In the upper-left corner of the console, select your cluster's region.

  3. Find your cluster and click its ID.

  4. On the Basic Information page, click Switch to Original Primary Zone.

  5. In the dialog box that appears, click OK.

Change primary zone

Alternatively, you can switch the cluster back by changing its primary availability zone. For more information, see Manually change an availability zone.