PolarDB supports the cross-zone automatic switchover feature.
Overview
After you enable the cross-zone automatic switchover feature for a PolarDB cluster, the cluster can automatically perform a switchover between the primary and secondary zones when resources in the primary zone of the cluster are unavailable. For example, all compute nodes in the primary zone fail at the same time. In this case, the secondary databases in the secondary zone are used as the new primary databases to restore the availability of the PolarDB cluster.
PolarDB allows you to replicate data across zones in semi-synchronous mode. This reduces the recovery point objective (RPO) of automatic switchover and prevents data loss. For more information, see Semisynchronous replication based on physical replication.
Usage notes
Your cluster is of PolarDB for MySQL Cluster Edition. Only PolarDB for MySQL Cluster Edition clusters support the cross-zone automatic switchover feature.
The hot standby cluster feature has been enabled for your cluster.
Your cluster uses the pay-as-you-go or subscription billing method.
Limits
RPO and RTO
In asynchronous scenarios, the cross-zone automatic switchover feature may cause data loss. In most cases, the recovery point objective (RPO) is less than 100 ms. In the worst cases, the RPO is less than 60 seconds. Evaluate the impact of a cross-zone automatic switchover before you use the feature.
In asynchronous scenarios, the recovery time objective (RTO) is less than 30 seconds.
Available resources are deployed in two or more zones within the region in which the PolarDB for MySQL cluster is deployed. The multi-zone deployment feature is unavailable in the following regions: Philippines (Manila), South Korea (Seoul), China (Qingdao), China (Chengdu), China (Hohhot), and Thailand (Bangkok).
Benefits
Switchover in seconds
After you enable the cross-zone automatic switchover feature for a PolarDB cluster, the PolarDB cluster automatically can perform a switchover between the primary and secondary zones in seconds if the compute nodes in the primary zone of the cluster are unavailable. This ensures the availability of the PolarDB cluster.
Billing
The cross-zone automatic switchover feature is provided free of charge.
Procedure
Use the cross-zone automatic switchover feature
Log on to the PolarDB console.
In the upper-left corner of the console, select the region in which the cluster that you want to manage resides.
Find the cluster and click the cluster ID.
In the left-side navigation pane, choose Settings and Management > Service Availability to go to the Cluster Availability page.
Click Cross-zone Automatic Switchover.
In the message that appears, click OK.
After you enable the cross-zone automatic switchover feature for the cluster, the cluster automatically performs a switchover between the primary and secondary zones when resources in the primary zone are unavailable.
(Optional) Enable the semi-synchronous mode for cross-zone data replication.
NoteSee the following differences between semi-synchronous mode and asynchronous mode:
Semi-synchronous mode: A transaction is successfully committed only after the redo logs generated by this transaction are persistently stored on the cross-zone backup node.
Asynchronous mode: A transaction is successfully committed after the redo logs generated by this transaction are persistently stored on the read/write node.
For more information, see Semisynchronous replication based on physical replication.
Click Modify Data Replication Mode.
In the dialog box that appears, set the Cross-zone Data Replication parameter to Semi-synchronous, and click OK.
Switch back to the original primary zone
After you enable the cross-zone automatic switchover feature for a cluster, you can switch to the original primary zone of the cluster by clicking Change Primary Zone or Switch to Original Primary Zone after resources in the original primary zone are recovered.
After the cluster automatically switches to the secondary zone, the network can be accessed across zones and access latency occurs. We recommend that you switch to the original primary zone of the cluster.
If you switch to the original primary zone of the cluster by clicking Switch to Original Primary Zone, the original vSwitch is used.
If you switch to the original primary zone of a cluster by clicking Change Primary Zone, you can select another vSwitch.
Switch back to the original primary zone
Log on to the PolarDB console.
In the upper-left corner of the console, select the region in which the cluster that you want to manage resides.
Find the cluster and click the cluster ID.
On the Basic Information page, click Switch to Original Primary Zone.
In the message that appears, click OK.
Change the primary zone
To switch back to the original primary zone, you can change the primary zone to the original primary zone. For more information, see Change the primary zone and vSwitch of a cluster.