All Products
Search
Document Center

ApsaraDB RDS:Add or remove a secondary role

Last Updated:Aug 24, 2026

After you create an RDS for MySQL Global Active Database (GAD) instance group, you can expand it by adding a secondary role — either by creating a new RDS instance or by joining an existing one. When your business needs change, you can remove a secondary role from the group. After removal, the instance continues to run as an independent RDS for MySQL instance.

Prerequisites

Before you begin, make sure that:

  • You have created a GAD database

  • The GAD database instance group status is Running

  • The primary and secondary instances are in different regions

The following regions support both active geo-redundancy and disaster recovery (DR):

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

  • China (Hong Kong)

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

Limitations

Limitation Details
Instance group capacity One primary role and 1–4 secondary roles per instance group
Region rules (GAD type) Secondary roles must be in regions different from the primary role; each secondary role must be in a unique region
Region rules (disaster recovery type) Secondary roles can be in the same region as or a different region from the primary role
Instance group membership An RDS for MySQL instance can belong to only one GAD instance group at a time, as either a primary or secondary role
Release or unsubscribe You cannot release (pay-as-you-go) or unsubscribe from (subscription) a secondary role instance while it is in the group. First remove the secondary role, then release the instance

Billing

The GAD database fee includes new RDS instance fees and Data Transmission Service (DTS) data synchronization fees. When you add an existing instance as a secondary role, no additional instance fee is charged, but DTS data synchronization fees apply. For details, see GAD database billing.

Add a secondary role

Two methods are available depending on whether you want to create a new instance or join an existing one.

Method 1: Create a new instance as a secondary role

Use this method when you need a new RDS instance dedicated to the secondary role.

New instance requirements

The new RDS for MySQL instance must meet the following requirements. For all other configuration options, see Create an RDS for MySQL instance.

Requirement Details
Region Must be in a supported region. See Prerequisites.
Instance type At least 2 cores and 4 GB (no specification limit for Serverless)
MySQL version 5.7 or 8.0
Storage capacity Must be greater than or equal to the total storage capacity of the primary role instance
To check the primary role's total storage capacity, go to its Basic Information page and view the Usage Statistics section.

Steps

  1. Go to the GAD instances page.

  2. In the Actions column for the target instance group, click Add Secondary Role.

    Alternatively, click image on the target GAD instance group's details page.
  3. Configure the new RDS for MySQL instance and the DTS data synchronization link. The DTS configuration options depend on the instance group type. For GAD type (active-active) For disaster recovery type

    When the instance group type is active-active

    Note

    In a GAD type instance group, the secondary role must be in a different region from the primary role, and each secondary role must be in a unique region.

    Important

    The synchronization type and synchronization scope of the primary role and secondary role in the same instance group must be consistent.

    Configuration item Description
    Data Synchronization Type Set to Two-way Synchronization by default.
    Conflict Resolution Policy Select based on your business needs. See Conflict types. Overwrite On Conflict: overwrites the conflicting record; task continues. Exit On Conflict: task fails and enters a failed state; manual repair required. Skip On Conflict: skips the conflicting statement; task continues.
    Primary role database account Only privileged account is supported.
    Primary role password The password for the primary role's privileged account.
    Synchronization Objects Click Get Synchronization Objects, select objects from Source Database Objects, and move them to Selected Objects. System libraries sys and __recycle_bin__ are not supported. To rename objects in the secondary role instance, click Batch Edit in Selected Objects. See Database, table, and column name mapping. To filter DML and DDL operations, right-click a synchronization object in Selected Objects.
    Secondary role database account The database account name of the secondary role instance.
    Secondary role password The database account password of the secondary role instance.
    Secondary role confirm password Re-enter the secondary role's database account password.

    When the instance group type is disaster recovery

    Configuration item Description
    Data Synchronization Type One-way Synchronization or Two-way Synchronization.
    Data Synchronization Scope For one-way sync: Entire Instance Synchronization or Specified Databases And Tables. For two-way sync: defaults to Specified Databases And Tables.
    Primary role database account Only privileged account is supported.
    Primary role password The password for the primary role's privileged account.
    Synchronization Objects Required only when syncing Specified Databases And Tables. Select objects from Source Database Objects and move them to Selected Objects. System libraries sys and __recycle_bin__ are not supported. To rename objects in the secondary role instance, click Batch Edit in Selected Objects. See Database, table, and column name mapping. To filter DML and DDL operations, right-click a synchronization object in Selected Objects.
    Secondary role database account The database account name of the secondary role instance.
    Secondary role password The database account password of the secondary role instance.
    Secondary role confirm password Re-enter the secondary role's database account password.
  4. Review the configuration and fee details. If everything looks correct, click Confirm Order, then click OK. The system automatically creates the secondary role instance and a DTS data synchronization link.

  5. After payment, the page redirects to the GAD instance group details page. Once the secondary role is added, it appears in the instance list alongside the DTS synchronization instance. For details, see View instance group information.

Method 2: Join an existing instance as a secondary role

Use this method when you already have an RDS for MySQL instance that meets the requirements and want to add it to the GAD instance group.

Existing instance requirements

Requirement Details
Instance type At least 2 cores and 4 GB (no specification limit for Serverless)
MySQL version Must match the major version of the primary role instance; only 5.7 and 8.0 are supported
Instance series High Availability Edition or Cluster Edition only
Storage capacity Must be greater than or equal to the total storage capacity of the primary role instance
Check these details on the instance's Basic Information page. If the instance type or storage capacity is insufficient, increase them via Change Configuration.

Steps

  1. Go to the RDS instance list, select a region, and click the ID of the target instance (the one to add as a secondary role).

  2. In the upper-right corner of the page, click Join GAD Database.

  3. In the dialog box, configure the secondary role and target GAD database.

    Configure secondary role information

    Configuration item Description
    Database Account (privileged) The database account of the secondary role. Only privileged accounts are supported. If no account exists, click Create Now to create one.
    Password The password for the secondary role's privileged account.

    Configure GAD database information

    Configuration item Description
    Region The region where the target GAD instance group is located.
    Select GAD Database (name/ID) The target GAD instance group.
    Database Account (privileged) The database account of the primary role. Only privileged accounts are supported. If no account exists, click Create Now to create one.
    Password The password for the primary role's privileged account.
  4. Click Check. After all prechecks pass, click Next.

  5. Configure the DTS data synchronization link, review the DTS synchronization fee details, and if everything looks correct, click Confirm, then click OK. The system automatically creates a DTS data synchronization link. The DTS configuration options depend on the instance group type. For disaster recovery type

    Important

    The synchronization type and synchronization scope of the primary role and secondary role in the same instance group must be consistent.

    When the instance group type is multi-active

    Configuration item Description
    Data Synchronization Type Set to Two-way Synchronization by default. No configuration required.
    Conflict Resolution Policy Select based on your business needs. See Conflict types. Overwrite On Conflict: overwrites the conflicting record; task continues. Exit On Conflict: task fails and enters a failed state; manual repair required. Skip On Conflict: skips the conflicting statement; task continues.
    Synchronization Account Type Set to User Account by default. No configuration required.
    Synchronization Objects Select objects from Source Database Objects and move them to Selected Objects. System libraries sys and __recycle_bin__ are not supported. To rename objects in the secondary role instance, click Batch Edit in Selected Objects. See Database, table, and column name mapping. To filter DML and DDL operations, right-click a synchronization object in Selected Objects.

    When the instance group type is disaster recovery

    Configuration item Description
    Data Synchronization Type One-way Synchronization or Two-way Synchronization.
    Data Synchronization Scope For one-way sync: Entire Instance Synchronization or Specified Databases And Tables. For two-way sync: defaults to Specified Databases And Tables.
    Conflict Resolution Policy Required only for two-way synchronization. Overwrite On Conflict: overwrites the conflicting record; task continues. Exit On Conflict: task fails and enters a failed state; manual repair required. Skip On Conflict: skips the conflicting statement; task continues. See Conflict types.
    Synchronization Account Type Set to User Account by default. No configuration required.
    Synchronization Objects Required only when syncing Specified Databases And Tables. System libraries sys and __recycle_bin__ are not supported. To rename objects in the secondary role instance, click Batch Edit in Selected Objects. See Database, table, and column name mapping.
  6. The page redirects to the GAD instance group details page. Once the secondary role is added, it appears in the instance list alongside the DTS synchronization instance. For details, see View instance group information.

Remove a secondary role

Important

Removing a secondary role is not the same as releasing the instance. After removal, the RDS for MySQL instance converts to read-write mode and continues to run as an independent instance — all data is preserved and existing database connections are not interrupted. The DTS synchronization link is terminated, but the instance itself is not deleted.

The table below clarifies the two operations:

Operation Effect on RDS instance Effect on DTS sync link
Remove secondary role Instance is retained, converted to read-write, and runs independently. Can be re-added to a GAD instance group as a new secondary role after passing constraint checks. Terminated
Release or unsubscribe Instance enters the recycle bin and is permanently deleted when it expires. You must remove the secondary role first. Terminated
To release the primary role instance, first remove all secondary roles, then delete the instance group, and finally release the primary role instance on the Instance List page.

Steps

  1. Go to the GAD database page.

  2. Click the instance ID of the target instance group.

  3. In the RDS Instance List section at the bottom of the page, click Remove in the Actions column for the secondary role.

  4. Click Delete.

What's next