PolarDB allows you to change the primary zone and the vSwitch of a cluster. You can use this feature to migrate the compute nodes of a cluster to another zone.

Scenarios and note

This feature is suitable for disaster recovery and scenarios in which you want to use an Elastic Compute Service (ECS) instance to access the PolarDB cluster node in the nearest zone.

Change the primary zone
  • If the destination zone is a secondary zone, data migration is not required. The system needs to migrate only compute nodes. Only an average of 5 minutes is required to migrate each compute node across data centers. This operation is commonly performed in disaster recovery drills.
  • If the destination zone is not a secondary zone, the data in the cluster must be migrated. The time required to migrate data depends on the volume of the data. Several hours may be required to migrate the data. Proceed with caution. In most cases, this operation is performed to change the zones where applications and databases are deployed. This way, an application can access a database from the nearest zone.
  • After you change the primary zone for a cluster, the cluster endpoints and the primary endpoint of the cluster remain unchanged. However, the vSwitch and the IP address of the cluster can change. This operation can affect the availability of the databases. Proceed with caution.

Procedure

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is deployed.
  3. Find the cluster and click the cluster ID.
  4. On the Overview page, click Migrate Cluster Across Zones.
    Migrate a cluster across zones
  5. In the dialog box that appears, configure Target Zone and Target VSwitch, and set Effective Time based on your business requirements.
    Dialog box
    Note
    • If the destination zone is a secondary zone, data migration is not required. The system needs to migrate only compute nodes. Only an average of 5 minutes is required to migrate each compute node across data centers. This operation is commonly performed in disaster recovery drills.
    • If the destination zone is not a secondary zone, the data in the cluster must be migrated. The time required to migrate data depends on the volume of the data. Several hours may be required to migrate the data. Proceed with caution. In most cases, this operation is performed to change the zones where applications and databases are deployed. This way, an application can access a database from the nearest zone.
    • If no vSwitch is available in the destination zone, you must create a vSwitch. For more information, see Create a vSwitch.
    • You can set Effective Time to Apply Immediately or Upgrade in Maintenance Window. If you select Upgrade in Maintenance Window, you can view the details of the scheduled task or cancel the task on the Scheduled Tasks page. For more information, see View or cancel a scheduled task.
  6. In the message that appears, click OK.

FAQ

  • How much time is required to change the primary zone?
    • If the destination zone is a secondary zone, data migration is not required. The system needs to migrate only compute nodes. Only an average of 5 minutes is required to migrate each compute node across data centers. This operation is commonly performed in disaster recovery drills.
    • If the destination zone is not a secondary zone, you must migrate the data when you change the primary zone. The time required to migrate data depends on the volume of the data. Several hours may be required to migrate a large amount of data. Proceed with caution. In most cases, this operation is performed to change the zones where applications and databases are deployed. This way, an application can access a database from the nearest zone.
    1
  • Is the time required to change the primary zone equal to the service downtime? For example, if I want to use a secondary zone as the primary zone, the average time required to migrate a node is 5 minutes. If a cluster has four nodes, is the service unavailable for approximately 20 minutes?

    No, the time required to change the primary zone is not equal to the service downtime. A transient connection occurs one or two times during the failover. Each transient connection lasts approximately 30 seconds. We recommend that you change the primary zone during off-peak hours and make sure that your applications can automatically reconnect to the cluster.

  • How does the system ensure that the cluster runs when the primary zone is being changed?

    After you change the primary zone for a cluster, the cluster endpoints and the primary endpoint of the cluster remain unchanged. Therefore, you can still use these endpoints to access the cluster. However, the vSwitch and IP address of the cluster can change. This operation can affect the availability of the databases. Proceed with caution.