This topic describes how to create a disaster recovery RDS instance for a primary ApsaraDB RDS for MySQL instance in a different region than the primary RDS instance. If your RDS instance is used for common business scenarios that require high data reliability or for financial business scenarios that must meet regulatory requirements, you can create a disaster recovery RDS instance to increase data reliability.

Prerequisites

  • Your RDS instance is a primary instance that runs one of the following MySQL versions and RDS editions:
    • MySQL 8.0 on RDS High-availability or Enterprise Edition
    • MySQL 5.7 on RDS High-availability or Enterprise Edition
    • MySQL 5.6
  • Your RDS instance has an internal endpoint. For more information, see View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for MySQL instance.
  • Your RDS instance is deployed in one of the following regions: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Shenzhen), China (Hong Kong), Singapore (Singapore), and US (Virginia).

Background information

A primary RDS instance and its disaster recovery RDS instance synchronize data with each other in real time by using Data Transmission Service (DTS). Both the primary and disaster recovery RDS instances are deployed based on the high-availability architecture. If the primary RDS instance and its secondary RDS instance cannot be connected due to unexpected exceptions, such as natural disasters, your database system fails over to the disaster recovery RDS instance. In this case, the disaster recovery RDS instance becomes the primary RDS instance of your database system. After you update the endpoint configuration on your application, your application can immediately connect to the new primary RDS instance.

You can use the DTS console to implement native features for the disaster recovery RDS instance. These features include synchronization object changes, synchronization speed settings, and latency alerts. For more information, see DTS documentation.

The following figure shows the topology of a database system with a disaster recovery RDS instance.

Topology of a database system with a disaster recovery RDS instance

A disaster recovery RDS instance has the following characteristics:

  • Provides separate endpoints. You can configure your application to automatically select an endpoint or manually update the endpoint.
  • Uses the high-availability architecture.
  • Uses the pay-as-you-go billing method.
  • Supports IP address whitelists and account management.

Billing

A primary RDS instance and its disaster recovery RDS instance have the same configuration, and data is synchronized between these instances in real time by DTS. If you create a disaster recovery RDS instance, you must pay for both ApsaraDB RDS and DTS. For more information, see the ApsaraDB RDS pricing page and the DTS pricing page.

Limits

  • A disaster recovery RDS instance does not support backup and restoration, data migration, database management, public endpoints, or endpoint modification.
  • A disaster recovery RDS instance does not synchronize operations such as database deletion from its primary RDS instance. After you delete a database from the primary RDS instance, you must log on to the disaster recovery RDS instance and delete the database by using an SQL statement.

Procedure

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the Distributed by Instance Role section of the Basic Information page, click Add to the right of RDS Instance. If you use the original ApsaraDB RDS console, click Add Guard in the Distributed by Instance Role section of the Basic Information page.
    Note If the preceding entry points cannot be found, you can check whether your RDS instance meets all the requirements that are described in the "Prerequisites" section of this topic.
  3. In the Create Data Synchronization Task wizard, specify the Database Account and Database Password parameters.
    Note
    • The account must have the REPLICATION SLAVE permission, the REPLICATION CLIENT permission, and the permissions to execute SELECT statements on all synchronization objects.
    • If your RDS instance runs MySQL 5.6, you do not need to specify the Database Account or Database Password parameter. Therefore, you can skip this step.
  4. Click Buy Instance.
  5. In the Purchase Secondary Instance for Disaster Recovery dialog box, select a region and click Purchase.
    Note
    • You can select only the region of the disaster recovery RDS instance. The disaster recovery RDS instance is billed on a pay-as-you-go basis, and all the other settings are the same as the settings of its primary RDS instance. If you want to upgrade the disaster recovery RDS instance after it is created, you can change its specifications in the ApsaraDB RDS console.
    • ApsaraDB RDS requires a few minutes to create the disaster recovery RDS instance. Before the disaster recovery RDS instance is created, do not close the dialog box. Otherwise, the creation may fail.
  6. Click Create account to create a privileged account that is used for data synchronization. After the disaster recovery RDS instance is created, its instance ID appears at Instance ID in the Destination Instance Details section.
    Note If your RDS instance runs MySQL 5.6, an account that is used by DTS for data synchronization is automatically created. Therefore, you can skip this step.
    Create account
  7. In the Create Data Synchronization Task wizard, specify the Database Account and Database Password parameters in the Destination Instance Details section. Then, click Set Whitelist and Next.
    Note If your RDS instance runs MySQL 5.6, you do not need to specify the Database Account and Database Password parameters. You can directly click Set Whitelist and Next. Then, you need only to wait until the account is created and click Next.
  8. In the Available section, select the objects that you want to synchronize. Click > to move the selected objects to the Selected section. Then, click Next.
    Note If you want to change the names of multiple tables at a time, select these tables and select Change Database and Table Names. Then, click Advanced Settings. Change the names of multiple tables at a time
    Select objects
  9. Set the Initial Synchronization parameter and click Precheck.
    Note During the Initial Synchronization process, DTS synchronizes the schemas and data of the selected objects from your RDS instance to the disaster recovery RDS instance. The schemas and data are the basis for DTS to synchronize subsequent incremental data. You can select the Initial Schema Synchronization or Initial Full Data Synchronization option. If you synchronize data for the first time, you must select both options.
    Initialize synchronization
  10. Perform the following operation. This step is required only when the precheck fails. If the precheck is successful, go to Step 14.

    Find each failed check item and click the icon next to Failed for the check item. Then, view details about the failure and troubleshoot issues that cause the failure.

    Failed
  11. On the Synchronization Tasks page, find the created synchronization task and click Start Task.
    Perform another synchronization
  12. After the precheck succeeds, click Close. The synchronization task starts.
    Successful precheck
  13. On the Synchronization Tasks page, query the created synchronization task and perform specific operations on the task. These operations include changing synchronization objects, configuring monitoring alerts, and changing the synchronization speed. For more information, see DTS documentation.
    Note To ensure that data on the disaster recovery RDS instance is up-to-date, do not pause the synchronization task.

FAQ

  • When do I use a disaster recovery RDS instance?

    If the primary RDS instance and its secondary RDS instance cannot be connected due to unexpected exceptions, such as natural disasters, your database system fails over to the disaster recovery RDS instance. In this case, the disaster recovery RDS instance becomes the primary RDS instance of your database system. After you update the endpoint configuration on your application, your application can immediately connect to the new primary RDS instance.

    Switchover to the primary RDS instance
  • Can I choose the subscription billing method for disaster recovery RDS instances?

    No, disaster recovery RDS instances support only the pay-as-you-go billing method.

  • Why do I find an account named dtssyncwriter that I did not create?

    If your primary RDS instance runs MySQL 5.6, an account named dtssyncwriter is automatically created when you create a disaster recovery RDS instance. The dtssyncwriter account is used for DTS to synchronize data. Do not modify or delete this account. Otherwise, synchronization errors occur.