Apsara PolarDB-P allows you to create multi-zone clusters. Compared with single-zone clusters, multi-zone clusters have better disaster recovery capabilities and can withstand breakdowns in data centers. 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 must have sufficient computing resources.

Multi-zone architecture

When a multi-zone cluster is deployed, data is distributed across zones. Compute nodes must be deployed in the primary zone. Apsara 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 a multi-zone architecture

When the prerequisites are met, a multi-zone cluster is created when you Create a POLARDB for PostgreSQL cluster.

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

Select the primary zone when creating a cluster

View the zones of a cluster

  1. Log on to the Apsara PolarDB console.
  2. In the upper-left corner of the console, select the region where the target cluster is deployed.
  3. Click the ID of the cluster that you want to manage.
  4. On the Overview page, view Zones.Zones

Change the primary zone

You can change the primary zone of an Apsara 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 Elastic Compute Service (ECS) instance is required to access the cluster in a nearby zone. Change the primary zone
  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, find the Node Information section and click Migrate Cluster Across Zones.
    Migrate a cluster across zones
  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 secondary 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 process may take several hours depending on the data size. Proceed with caution. This operation is used to adjust the zones of applications and databases to speed up access from a nearby zone.
  6. Click OK.
    Notice After the primary zone is changed, the primary endpoints and cluster endpoints remain unchanged, but the VSwitch and IP address may be changed. This operation may disrupt your database service for less than 60 seconds. Proceed with caution.