PolarDB for MySQL allows you to deploy a cluster across multiple zones. Compared with single-zone clusters, multi-zone clusters have better disaster recovery capabilities and can withstand data center-level faults. This topic describes how to deploy a cluster across multiple zones and change the primary zone.

Prerequisites

  • The region must contain at least two zones.
  • The zones have sufficient computing resources.

Multi-zone architecture

When a multi-zone cluster is deployed, data is distributed across multiple zones. Compute nodes must be deployed in the primary zone. ApsaraDB for PolarDB reserves sufficient resources in a secondary zone to ensure a successful failover when the primary zone fails. The following figure shows the multi-zone architecture.

Architecture

Billing

No additional fee is required for multi-zone deployment.
Note You can upgrade a single-zone cluster to a multi-zone cluster for free.

Establish the multi-zone architecture

If the prerequisites are met, a multi-zone cluster is created when you create a PolarDB for MySQL cluster.

You can also upgrade existing single-zone clusters to multi-zone clusters. This upgrade is achieved by online migration, and does not affect your business.

Select the primary zone when creating a cluster

View the zones of a cluster

  1. Log on to the ApsaraDB for PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is located.
  3. Click the ID of the cluster.
  4. On the Overview page, view Zones.Zones

Change the primary zone

You can change the primary zone of an ApsaraDB for PolarDB cluster. This feature allows you to migrate the compute nodes of a database cluster to a different zone. This is applicable to scenarios such as disaster recovery or when an ECS instance is required to access the cluster in a nearby zone. Change the primary zone
  1. Login ApsaraDB for PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is located.
  3. Find the target cluster and click the cluster ID.
  4. On the Overview page, click Migrate Across Zones.
    Migrate an instance to a different zone
  5. In the Migrate Cluster Across Zones dialog box that appears, select Target Zone and Target VSwitch.
    Dialog box
    Note
    • If the destination zone is a secondary zone, data migration is not required. Switching to a new primary zone is fast because only compute nodes are switched. The average time required to migrate a compute node is five minutes. This operation is often performed during disaster recovery drills.
    • If the destination zone is not a secondary zone, data must be migrated. This migration may take several hours because of the huge volume of data. Proceed with caution. This operation is often used to deploy applications and databases in a zone to speed up access from a nearby zone.
  6. Click Confirm.
    Notice After the primary zone is changed, the primary endpoints and cluster endpoints remain unchanged, but the VSwitch and the IP address may be changed. This operation may affect the database availability. Proceed with caution.