A global database network (GDN) consists of multiple PolarDB clusters that are distributed across regions around the world. Data is synchronized across all the clusters in each GDN. If your services are deployed in multiple regions, you can use GDNs to allow the applications to gain low-latency and reliable access to the databases. This topic describes how to add and remove secondary clusters.

Notes

  • You cannot specify existing clusters as secondary clusters. To use a secondary cluster, create a cluster and specify it as a secondary cluster.

Add a secondary cluster

  1. Log on to the PolarDB console.

  2. Find the ID of the GDN where you want to create a secondary cluster. Then, in the Actions column of the GDN, click Add Secondary Cluster.
    1
    Note You cannot specify an existing cluster as a secondary cluster in a GDN.
  3. On the buy page that appears, select Subscription or Pay-As-You-Go.
  4. Specify the parameters that are listed in the following table.
    Parameter Description
    Region The region where the cluster is deployed. You cannot change the region after the cluster is created.
    Note Make sure that the PolarDB cluster and the Elastic Compute Service (ECS) instance to be connected are deployed in the same region. Otherwise, the cluster and the ECS instance cannot communicate through the internal network and can communicate through only the Internet. This compromises the performance.
    Create Type The type of the cluster to be created. Select Create Secondary Cluster.
    GDN The GDN in which you want to create a secondary cluster.
    Note By default, the GDN is the one that you select before you create the secondary cluster.
    Primary Availability Zone The primary zone where the cluster is deployed.
    • Each zone is an independent geographical location that resides in a region. All the zones in a region provide the same services.
    • You can deploy your PolarDB cluster and ECS instance in the same zone or in different zones.
    • You need to specify only the primary zone. The system automatically selects a secondary zone.
    Network Type The fixed value VPC is used. Therefore, you do not need to specify this parameter.
    Note Before you use the classic network, select a virtual private cloud (VPC). After the cluster is created, configure the classic network. For more information, see VPC-facing endpoints and public-facing endpoints.
    VPC

    VSwitch

    Ensure that the PolarDB cluster and the ECS instance to be connected are deployed in the same VPC. Otherwise, the cluster and the ECS instance cannot communicate over the internal network. This compromises the performance.
    • If you have created a VPC that meets your requirements for network planning, select this VPC. For example, if you have created an ECS instance and the VPC where the ECS instance resides suits your network needs, select this VPC.
    • Otherwise, use the default VPC and the default vSwitch.
      • Default VPC:
        • Only one VPC is used as the default VPC in the selected region.
        • The subnet mask for the default VPC consists of 16 bits. For example, the CIDR block of the default VPC can be 172.31.0.0/16. A maximum of 65,536 private IP addresses can be assigned.
        • The default VPC does not consume the quota of VPCs that you can create.
      • Default vSwitch:
        • Only one vSwitch is used as the default vSwitch in the selected region.
        • The subnet mask for the default vSwitch consists of 20 bits. For example, the CIDR block of the default vSwitch can be 172.16.0.0/20. A maximum of 4,096 private IP addresses can be assigned.
        • The default vSwitch does not consume the quota of vSwitches that you can create in a VPC.
    • If the default VPC and vSwitch cannot meet your business requirements, you can create your own VPC and vSwitch. For more information, see Create a VPC.
    Compatibility Only MySQL 8.0 is supported. This value is automatically used. Therefore, you do not need to specify this parameter.
    Edition Only the Cluster (2-16 Nodes) (Recommended) option is supported. This option is automatically used. Therefore, you do not need to specify this parameter.
    Node Specification Select the node specifications as needed. All the nodes in the cluster are dedicated nodes that offer stable and reliable performance. For more information about node specifications, see Specifications and pricing.
    Nodes By default, each Standard (2-16 Nodes) (Recommended) cluster consists of one primary node and one read-only node. The two nodes have the same specifications. Therefore, you do not need to specify this parameter.
    Note If the primary node fails, the system uses the read-only node as the primary node and generates another read-only node. For more information about read-only nodes, see Architecture.
    Storage Cost You do not need to specify this parameter. You are charged for the used storage space on an hourly basis. For more information, see Pricing.
    Note You do not need to select a storage capacity when you create a cluster. The system automatically scales the storage capacity based on the amount of data to be stored.
    Time Zone The time zone of the cluster. The default value is UTC+08:00.
    Table Name Case Sensitivity Specifies whether table names are case-sensitive. The default value is Not Case-sensitive. If table names are case-sensitive in your on-premises database, we recommend that you select Case-sensitive. This ensures that you can migrate data in an easy way.
    Note The value of this parameter cannot be changed after the cluster is created. Proceed with caution.
    Release Cluster The backup retention policy that is used after the cluster is deleted or released. The default value is Retain Last Automatic Backup (Automatic Backup before Release).
    • Retain Last Automatic Backup (Automatic Backup before Release): retains the last backup after you delete the cluster.
    • Retain All Backups: retains all backups after you delete the cluster.
    • Delete All Backups (Cannot be restored): retains no backups after you delete the cluster.
    Note If you need to retain backups after you delete or release the cluster, you may need to pay a few fees. You can delete the backups to reduce costs. For more information, see Data backup pricing (beyond the free quota).
    Cluster Name
    • The name of the new cluster. The cluster name must be 2 to 128 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-).
    • If you leave this parameter empty, the system automatically generates a cluster name. You can change the cluster name after the cluster is created.
    Resource Group Select a resource group from available resource groups. For more information about how to create a resource group, see Create a resource group.
    Note A resource group is a container that contains a group of resources in an Alibaba Cloud account. You can perform centralized management on these resources. A resource belongs to only one resource group. For more information, see Use RAM to create and authorize resource groups.
  5. Set the Purchase Plan and Number parameters, and click Buy Now on the right. The Purchase Plan parameter is required only if you purchase a subscription cluster.
  6. On the Confirm Order page, confirm your order information. Read and accept the terms of service, and then click Buy Now.
  7. On the Purchase page, confirm the unpaid order and the payment method and click Purchase.
  8. After you complete the payment, wait for 10 to 15 minutes. Then, you can view the newly created secondary cluster on Clusters.

Detach a secondary cluster

  1. Log on to the PolarDB console.

  2. Find the GDN that you want to manage and click GDN ID/Name.
    ID
  3. In the Clusters section, find the Secondary Cluster that you want to detach and click Detach in the Actions column.
    Note
    • The whole detachment process requires about 5 minutes.
    • During detachment, the endpoints of all the clusters in the GDN (including the cluster that is being detached) are available. You can still use the endpoints to access databases.
    • Only secondary clusters can be detached from a GDN. The primary cluster cannot be detached from a GDN.
    • After a secondary is detached from the current GDN, the primary cluster stops synchronizing data to the secondary cluster, and the secondary cluster mode is set to read/write.
    • After a secondary cluster is detached, the cluster cannot be added to the GDN again as a secondary cluster. Proceed with caution.
    Detach a cluster
  4. In the message that appears, click OK.