Add and manage secondary clusters

Updated at:

After you create a Global Database Network (GDN), you can create clusters and add them to the GDN as secondary clusters. When a secondary cluster is no longer needed, you can remove it from the GDN. A removed secondary cluster can still be used as a standalone PolarDB cluster.

Applicable scope

You must Create a global database network before you can add a secondary cluster to the GDN.

Supported regions

All regions in the Chinese mainland, China (Hong Kong), Japan (Tokyo), South Korea (Seoul), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Philippines (Manila), Thailand (Bangkok), Germany (Frankfurt), US (Silicon Valley), US (Virginia), and UK (London).

Feature limitations

  • Clusters in a Global Database Network (GDN) support the In-Memory Column Index (IMCI) feature. However, you must enable the loose_polar_enable_imci_with_standby cluster parameter and the cluster version must meet one of the following requirements before you can add a read-only column-oriented node.

    • MySQL 8.0.1 with a revision version of 8.0.1.1.48 or later.

    • MySQL 8.0.2 with a revision version of 8.0.2.2.27 or later.

  • Clusters in a GDN can be serverless clusters or clusters with defined specifications that have the serverless feature enabled. However, if the database engine version of the primary cluster is earlier than the following versions, all clusters in the GDN must have at least one read-only node:

    • MySQL 8.0.1 with a minor engine version earlier than 8.0.1.1.42.

    • MySQL 8.0.2 with a minor engine version earlier than 8.0.2.2.23.

  • Clusters in a GDN do not support database and table restoration.

Other limitations

  • A GDN consists of one primary cluster and up to four secondary clusters.

    Note

    To add more secondary clusters, go to Quota Center, find the quota item with the ID polardb_mysql_gdn_region, and click Apply in the Actions column.

  • A cluster can belong to only one GDN.

  • Only new clusters can be added as secondary clusters; you cannot use existing ones.

  • The primary and secondary clusters must use the same database engine version: MySQL 8.0, MySQL 5.7, or MySQL 5.6.

  • For secondary clusters in a GDN that are not serverless clusters, each compute node must have at least 4 CPU cores.

  • By default, each cluster in a GDN contains 2 nodes. You can add up to 16 nodes.

Pricing

Charges for a Global Database Network (GDN) consist of the cluster costs and any applicable cross-border data replication fees. The billing rules are as follows:

Important

Cross-border data transfer fees will be charged starting from 00:00:00 on February 1, 2026 (UTC+8). Before this date, this service is free of charge. For more information, see [Notice] Announcement on network fee adjustment for Global Database Network (GDN).

  • Free scenarios:

    Your primary and secondary clusters are both deployed in regions within the Chinese mainland, or both are deployed in the China (Hong Kong) region or other overseas regions. Examples:

    • Both the primary and secondary clusters are in the Chinese mainland. For example, the primary cluster is in China (Chengdu) and the secondary clusters are in regions such as China (Hangzhou) or China (Shenzhen).

    • Both the primary and secondary clusters are in the China (Hong Kong) region or other overseas regions. For example, the primary cluster is in Singapore and the secondary cluster is in Philippines (Manila).

  • Billable scenarios:

    Cross-border fees apply when a GDN spans the Chinese mainland border—for example, if one cluster is in the Chinese mainland and another is in China (Hong Kong) or an overseas region. Examples:

    • The primary cluster is in the Chinese mainland and the secondary cluster is outside the Chinese mainland. For example, the primary cluster is in China (Chengdu) and the secondary cluster is in a region such as China (Hong Kong) or Singapore.

    • The primary cluster is outside the Chinese mainland and the secondary cluster is in the Chinese mainland. For example, the primary cluster is in Singapore and the secondary cluster is in a region such as China (Hangzhou) or China (Shenzhen).

  • Billing rule: CNY 5.6 per GB, billed hourly. The fee is calculated hourly based on the volume of redo log data physically replicated from the primary cluster to a cross-border secondary cluster. This traffic fee can be estimated by querying the physical position converted from the log sequence number (LSN).

    Billing example

    Example

    At 09:00, you query the physical write position of the log and find it is ib_logfile1/648143676. At 10:00, the position is updated to ib_logfile3/648142342. The amount of data written in this hour is the difference between the two positions.

    1. Amount written to the start file (ib_logfile1):
      Subtract the start offset from the total file size. Each log file is 1 GB (1,073,741,824 bytes). The amount written is 1073741824 - 648143676 = 425598148 bytes.



    2. Amount written to the intermediate file (ib_logfile2):
      After ib_logfile1 is full, the system completely writes ib_logfile2. This amount is 1,073,741,824 bytes (1 GB).



    3. Amount written to the end file (ib_logfile3):
      This is the offset at the end, which is 648142342 bytes.



    Therefore, the total amount written is 425598148 + 1073741824 + 648142342 = 2147482314 bytes. This is 2147482314 / 1024 / 1024 / 1024 = 1.999998 GB (rounded down to six decimal places). The cross-border data transfer fee for this hour is approximately 1.999998 GB × CNY 5.6/GB = CNY 11.1999888.

    Query the log write progress and physical file offset

    -- Query the current write progress of the log system.
    SHOW STATUS LIKE 'Innodb_log_write_lsn'; 
    +----------------------+------------+
    | Variable_name        | Value      |
    +----------------------+------------+
    | Innodb_log_write_lsn | 1721889596 |
    +----------------------+------------+
    
    -- Query the physical file offset in bytes.
    SELECT lsn_to_pos(1721889596); 
    +------------------------+
    | lsn_to_pos(1721889596) |
    +------------------------+
    | ib_logfile1/648143676  |
    +------------------------+
Note

If you use the global domain name feature, you will incur additional fees for internal DNS resolution and inter-region data transfer. For more information, see Global domain name pricing.

Usage notes

A Global Database Network (GDN) synchronizes data by using physical replication based on Redo Log. Therefore, by default, you do not need to Enable binary logging. If your workload requires binary log synchronization between clusters, for example for data subscription, make sure that the binary log parameter (loose_polar_log_bin) is configured identically on the primary cluster and the secondary clusters. Otherwise, binary log data may be inconsistent after you Switch the primary cluster.

Add a secondary cluster

A Global Database Network (GDN) supports adding cross-border secondary clusters based on China Unicom cross-border Express Connect and cross-border Cloud Enterprise Network (CEN). A configuration is cross-border when the primary cluster and the secondary cluster to be added are in the following two different groups of regions. Adding a cross-border secondary cluster requires additional preparations.

Note
  • China Unicom cross-border Express Connect and cross-border Cloud Enterprise Network (CEN), collectively referred to as cross-border services, are cross-border data products for enterprise customers. These products are jointly offered by Alibaba Cloud Computing Co., Ltd. (Alibaba Cloud) and China Unicom. The cross-border circuits, also known as cross-border leased lines, are data connection services operated by Zhejiang Unicom and provided to you through Alibaba Cloud sales channels. For more information, see Cross-border service FAQ.

  • If your primary cluster is in US (Silicon Valley) or US (Virginia) and the secondary cluster to be added is in the Chinese mainland or China (Hong Kong), submit a ticket to contact us.

  • Chinese mainland: China (Hangzhou), China (Shanghai), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), and China (Chengdu).

  • Other regions: China (Hong Kong), Japan (Tokyo), South Korea (Seoul), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Philippines (Manila), Thailand (Bangkok), Germany (Frankfurt), US (Silicon Valley), US (Virginia), and UK (London).

Preparations (cross-border secondary clusters only)

  1. Sign the PolarDB Cross-border Data Transmission Compliance Commitment.

  2. Apply for a China Unicom cross-border leased line.

  3. Activate the Cloud Data Transfer (CDT) cross-border service.

Procedure

Note

The time required to create a cluster depends on the data volume of the primary cluster. The initial data copy is slow, so wait for it to complete.

  1. Log on to the PolarDB console. In the left-side navigation pane, click Global Database Network (GDN).

  2. On the Global Database Network (GDN) page, find the target GDN. In the Actions column, click Add Secondary Cluster.

  3. On the purchase page that appears, configure the following parameters. Configure other parameters based on your business requirements. For more information, see Custom purchase.

    • Region: Select the region where you want to add the secondary cluster.

    • Creation Method: Select Create Secondary Cluster.

    • GDN: Select the GDN to join. The target GDN selected in the previous step is used by default.

    • Database Engine: The database engine must be the same as that of the primary cluster: MySQL 8.0, MySQL 5.7, or MySQL 5.6.

    • Compute node specifications: When you create the secondary cluster, use the same node specifications as the primary cluster to ensure low-latency synchronization. The number of read-only nodes does not need to match that of the primary cluster. Select the number based on the read request volume of the local secondary cluster.

  4. After the purchase is complete, return to the Global Database Network (GDN) page, find the target GDN, and click GDN ID/Name to open the GDN details page. The new secondary cluster appears in the Clusters section. After the secondary cluster is created, you can view the status, role, and replication latency of each cluster in the Cluster list. The Actions column of a secondary cluster provides links to Remove and Switch to Primary Cluster. Each GDN can contain up to five clusters: one primary cluster and up to four secondary clusters.

    Note
    • The time required to create a secondary cluster depends on the data volume of the primary cluster. The initial data copy is slow, so wait for it to complete.

    • Creating a secondary cluster has minimal impact on the performance of the primary cluster.

    • You cannot create database accounts on a secondary cluster. Create accounts on the primary cluster, and the system automatically synchronizes them to the secondary cluster.

Remove a secondary cluster

  1. Log on to the PolarDB console. In the left-side navigation pane, click Global Database Network (GDN).

  2. On the Global Database Network (GDN) page, find the target GDN, and click GDN ID to open the GDN details page.

  3. In the Clusters section, find the target secondary cluster. In the Actions column, click Remove.

    Note
    • The entire removal process takes about 5 minutes.

    • During the removal process, the endpoints of all clusters in the GDN, including the secondary cluster being removed, remain available. You can continue to access the database by using the cluster endpoints.

    • Only secondary clusters can be removed from a GDN. The primary cluster cannot be removed.

    • After a secondary cluster is removed from a GDN, it stops synchronizing data with the primary cluster, and the system sets the cluster to read/write mode.

    • After a cluster is removed from a GDN, it cannot be added to the GDN again as a secondary cluster. Proceed with caution.

  4. Carefully read the notes in the dialog box that appears. After you confirm that the information is correct, click OK to remove the secondary cluster.

Switch the primary cluster

  1. Log on to the PolarDB console. In the left-side navigation pane, click Global Database Network (GDN).

  2. On the Global Database Network (GDN) page, find the target GDN, and click GDN ID to open the GDN details page.

  3. In the Clusters section, find the target secondary cluster. In the Operation column, click Switch to Primary Cluster.

  4. In the Primary/Secondary Switchover dialog box, select the cluster ID of the secondary cluster to use as the new primary cluster, and click OK.

    Note
    • A primary/secondary switchover does not swap the endpoints of the two clusters, so check your application configuration. If the original primary cluster in the GDN has a public endpoint, make sure that the new primary cluster also has a public endpoint. Otherwise, applications cannot access the database. To view cluster endpoints, see View endpoints and ports.

    • A primary/secondary switchover in a GDN completes within 10 minutes (test results show that it takes less than 5 minutes). During the switchover, transient disconnections of up to 160 seconds may occur. Perform the switchover during off-peak hours and make sure that your application has a reconnection mechanism.

    • In the Primary/Secondary Switchover dialog box, if you turn on Forced Switchover, the following applies:

      • You cannot specify a target cluster for a forced switchover. By default, the system selects the secondary cluster with the largest log sequence number (LSN) as the new primary cluster.

      • A forced switchover carries a risk of data loss. After the switchover, the original primary cluster is automatically removed. Proceed with caution.

Recreate a secondary cluster

Use cases

You may need to recreate a secondary cluster in a GDN in the following situations:

  • A secondary cluster fails and cannot be recovered. Recreate the secondary cluster to restore the service.

  • You need to update the basic configuration or environment of the secondary cluster.

  • The secondary cluster has been out of sync with the primary cluster for an extended period. Recreate it to ensure data consistency between the primary and secondary clusters.

Important

The specified secondary cluster is unavailable while it is being recreated. Proceed with caution.

Procedure

  1. Log on to the PolarDB console. In the left-side navigation pane, click Global Database Network (GDN).

  2. On the Global Database Network (GDN) page, find the target GDN, and click GDN ID to open the GDN details page.

  3. In the Clusters section, find the target secondary cluster. In the Operation column, click Recreate Secondary Cluster.

  4. Carefully read the notes in the dialog box that appears. After you confirm that the information is correct, click OK.

FAQ

How do I view the bill for cross-border fees?

You can view the bill on the Expenses and Costs > Bill > Bill Details page. The bill lists the product as Alibaba Cloud Marketplace (Third Party) and China Unicom Cross-border Data Transmission, and the billing item as China Unicom Cross-region Traffic.

Why does the theoretical traffic consumption not match the actual bill?

The system's data collection tasks do not run exactly on the hour and may deviate by several minutes. This can cause slight differences between the theoretical hourly traffic and the actual billed traffic. The difference is typically within 10%.

Why are small cross-border fees still generated when the primary cluster has no writes?

The primary cluster periodically performs background maintenance tasks such as data cleanup. These tasks generate a small amount of Redo Log data, approximately 0.0005 GB per hour. The logs are also synchronized to the secondary cluster, so you incur a small fee.

How do I determine whether I have signed the PolarDB Cross-border Data Transmission Compliance Commitment?

If you have not signed the commitment, the following message appears on the purchase page when you add a cross-border secondary cluster: Cross-border data transfer exists between the region of the secondary cluster and the region of the primary cluster. Sign the Cross-border Data Transmission Compliance Commitment before you create the cluster.

Related documentation

Related API operations

API

Description

CreateDBCluster

Use the cluster creation API operation to add a secondary cluster to a Global Database Network. Set the following parameters:

  • CreationOption: CreateGdnStandby.

  • GDNId: Enter the ID of the target Global Database Network.

RemoveDBClusterFromGDN

Removes a secondary cluster from a Global Database Network.

SwitchOverGlobalDatabaseNetwork

Switches the primary cluster of a Global Database Network.