tencent cloud

Feedback

Creating Remote Disaster Recovery by DTS

Last updated: 2023-11-22 14:47:43
    TDSQL-C for MySQL allows you to use Data Transmission Service (DTS) to implement remote disaster recovery to ensure database availability and stability.

    Overview

    If your TDSQL-C for MySQL cluster is deployed in a single region, your service is more likely to be interrupted by force majeure like power outages and network disconnection.
    To prevent this problem, you can build a disaster recovery center in another region to improve service availability. DTS allows you to continually sync data and replicas between your business center and disaster recovery center. In case of a failure in your business region, you can switch to the disaster recovery region to process user requests.
    With the remote disaster recovery architecture, if a disaster occurs in an IDC, the traffic in this IDC can be routed to other IDCs to implement quick cross-region failover and guarantee business continuity.

    Remote Disaster Recovery Directions

    Step 1. Purchase a cluster Go to the TDSQL-C for MySQL purchase page and purchase two TDSQL-C for MySQL clusters in two different regions, with one deployed in your business center and the other in the disaster recovery center.
    Note:
    For data sync prerequisites and environment requirements, see Sync from TDSQL-C for MySQL to TDSQL-C for MySQL.
    Step 2. Use DTS to implement remote disaster recovery
    1. Go to the data sync purchase page, select appropriate configuration items, and click Buy Now.
    Parameter
    Description
    Billing Mode
    Pay-as-you-go billing and monthly subscription are supported.
    Source Instance Type
    Select "TDSQL-C for MySQL", which cannot be changed after purchase.
    Source Instance Region
    Select the source instance region, which cannot be changed after purchase.
    Target Instance Type
    Select "TDSQL-C for MySQL", which cannot be changed after purchase.
    Target Instance Region
    Select the target instance region, which cannot be changed after purchase.
    Specification
    Select a specification based on your business needs. The higher the specification, the higher the performance. For more information, see Billing Overview.
    2. After successful purchase, return to the data sync task list, and you can see the newly created data sync task. You need to configure it before using it.
    3. In the data sync task list, click Configure in the Operation column to enter the sync task configuration page.
    4. On the sync task configuration page, configure the source and target instances and their accounts and passwords, test the connectivity, and click Next. As there are many overlapped scenarios of source database deployment modes and access types, the sync steps for different scenarios are similar. Below is a configuration example for typical scenarios, to which you can refer for other scenarios.
    Sync between TDSQL-C for MySQL instances is used as an example.
    Category
    Parameter
    Description
    Task Settings
    Task Name
    DTS will automatically generate a task name, which is customizable.
    Running Mode
    Immediate execution and scheduled execution are supported.
    Source Instance Settings
    Source Instance Type
    Select the source instance type selected during purchase, which cannot be changed once configured.
    Source Instance Region
    Select the source instance region selected during purchase, which cannot be changed once configured.
    Service Provider
    For a self-built database (such as a CVM-based one) or TencentDB database, select "Others". For a third-party cloud database, select the corresponding service provider.In this scenario, select "Others".
    Access Type
    Select a type based on your scenario. In this scenario, select "Database". For the preparations for different access types, see Overview.
    Public Network: The source database can be accessed through a public IP.
    Self-Build on CVM: The source database is deployed on a CVM instance.
    Direct Connect: The source database can be interconnected with VPCs through Direct Connect.
    VPN Access: The source database can be interconnected with VPCs through VPN Connections.
    Database: The source database is a TencentDB database.
    CCN: The source database can be interconnected with VPCs through CCN.
    VPC: The source and target databases are both deployed in Tencent Cloud VPCs. To use the VPC access type, submit a ticket for application.
    Instance ID
    Source instance ID. You can view the source instance information in the cluster list.
    Account
    Account of the source instance, which must have the required permissions.
    Password
    Password of the source instance account.
    Target Instance Settings
    Target Instance Type
    The target instance type selected during purchase, which cannot be changed.
    Target Instance Region
    The target instance region selected during purchase, which cannot be changed.
    Access Type
    Select a type based on your scenario. In this scenario, select "Database".
    Instance ID
    Target instance ID.
    Account
    Account of the target instance, which must have the required permissions.
    Password
    Password of the target instance account.
    
    5. On the Set sync options and objects page, set the data initialization, data sync, and sync object options and click Save and Go Next.
    Note:
    If you only select Full data initialization for Initialization Type, the system will assume by default that you have created the table structures in the target database and will neither sync table structures nor check whether the source and target databases have tables with the same name. Therefore, if you select Precheck and report error for If Target Already Exists, the precheck and error reporting feature won't take effect.
    If you want to rename a table (for example, rename table A "table B") during the sync, you must select the entire database (or entire instance) where table A resides rather than only table A as the sync object; otherwise, the system will report an error.
    Category
    Parameter
    Description
    Data Initialization Option
    Initialization Type
    Structure initialization: Table structures in the source database will be initialized into the target database before the sync task runs.
    Full data initialization: Data in the source database will be initialized into the target database before the sync task runs. If you only select Full data initialization, you need to create the table structure in the target database in advance. Both options are selected by default, and you can deselect them as needed.
    If Target Already Exists
    Precheck and report error: If a table with the same name exists in both the source and target databases, an error will be reported, and the task will stop.
    Ignore and execute: Full and incremental data will be directly added to tables in the target instance.
    Data Sync Option
    Conflict Resolution Method
    Report: If a primary key conflict is found during data sync, an error will be reported, and the data sync task will be paused.
    Ignore: If a primary key conflict is found during data sync, the primary key record in the target database will be retained.
    Overwrite: If a primary key conflict is found during data sync, the primary key record in the source database will overwrite that in the target database.
    SQL Type
    Supported operations include INSERT, UPDATE, DELETE, and DDL. If you select "Custom DDL“, you can select different DDL statement sync policies as needed. For more information, see Setting SQL Filter Policy.
    Sync Object Option
    Database and Table Objects of Source Instance
    Select the objects to be synced. You can select basic databases, tables, views, procedures, and functions. The sync of advanced objects is a one-time operation: only advanced objects already in the source database before the task start can be synced, while those added to the source database after the task start will not be synced to the target database. For more information, see Syncing Advanced Object.
    Selected Object
    Database/Table mapping (renaming) is supported. Hover over a database or table name, click the displayed ”Edit“ icon, and enter a new name in the pop-up window.
    When advanced objects are selected for sync, we do not recommend that you rename databases/tables. If you do so, sync of the advanced objects may fail.
    Sync Online DDL Temp Table
    If you use the "gh-ost" or "pt-osc" tool to perform online DDL operations on source database tables, DTS supports migrating the generated temp tables to the target database.
    If you select `gh-ost`, DTS will migrate the temp tables named `_Table name_ghc`, `_Table name_gho`, and `_Table name_del` to the target database.
    If you select "pt-osc", DTS will migrate the temp tables named `_Table name_new` and `_Table name_old` to the target database.
    For more information, see Syncing Online DDL Temp Table.
    6. On the task verification page, complete the verification. After all check items are passed, click Start Task. If the verification fails, troubleshoot as instructed in Check Item Overview and initiate the verification again.
    Failed: It indicates that a check item failed and the task is interrupted. You need to fix the problem and run the verification task again.
    Alarm: It indicates that a check item doesn't completely meet the requirements. The task can be continued, but the business will be affected. You need to assess whether to ignore the alarm or fix the problem and continue the task based on the alarm message.
    7. Return to the data sync task list, and you can see that the task has entered the Running status.
    Note:
    You can click More > Stop in the Operation column to stop a sync task. Before doing so, ensure that data sync has been completed.
    8. (Optional) You can click a task name to enter the task details page and view the task initialization status and monitoring data.
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support