Creating a DR Task
Scenario
To prevent service unavailability caused by regional faults, DRS provides disaster recovery to ensure service continuity. If the region where the primary instance is located encounters a natural disaster and cannot be connected, you can switch the remote instance to the primary instance. To reconnect to the primary instance, you only need to change the connection address on the application side. DRS allows you to perform cross-region real-time synchronization between a primary instance and a DR instance during disaster recovery
A complete online disaster recovery consists of creating a DR task, tracking task progress, analyzing DR logs, and comparing data consistency. By comparing multiple items and data, you can synchronize data between different service systems.
Process
The following flowchart shows the basic processes for disaster recovery.
- Step 1: Create a DR task. Select the service and DR databases as required and create a DR task.
- Step 2: Query the DR progress. During the disaster recovery, you can view the DR progress.
- Step 3: View DR logs. Disaster recovery logs contain alarms, errors, and prompt information. You can analyze system problems based on such information.
- Step 4: Compare DR items. The DR system supports object-level, data-level comparison to ensure data consistency.
This section uses disaster recovery from a MySQL instance to an RDS for MySQL instance as an example describes how to configure a DR task on the DRS console over a public network.
You can create a DR task that will walk you through each step of the process. After a DR task is created, you can manage it on the DRS console.
Prerequisites
- You have logged in to the DRS console.
- For details about the supported DB types and versions, see Real-Time Disaster Recovery.
Procedure
- On the Disaster Recovery Management page, click Create Disaster Recovery Task.
- On the Create Disaster Recovery Instance page, specify the task name, description, and the DR instance details, and click Create Now.
- Task information description
Table 1 Task and recipient description Parameter
Description
Task Name
The task name must start with a letter and consist of 4 to 50 characters. It can contain only letters, digits, hyphens (-), and underscores (_).
Description
The description consists of a maximum of 256 characters and cannot contain special characters !=<>'&"\
- DR instance information
Table 2 DR instance settings Parameter
Description
Disaster Recovery Relationship
Select Current cloud as standby.
By default, Current cloud as standby is selected. You can also select Current cloud as active.
- Current cloud as standby: The DR database is on the current cloud.
- Current cloud as active: The service database is on the current cloud.
Service DB Engine
Select MySQL.
DR DB Engine
Select MySQL.
Network Type
The public network is used as an example.
Available options: VPN or Direct Connect and Public network. By default, the value is Public network.
DR DB Instance
RDS DB instance you have created as the destination database of the DR task.
Disaster Recovery Instance Subnet
Select the subnet where the disaster recovery instance is located. You can also click View Subnets to go to the network console to view the subnet where the instance resides.
By default, the DRS instance and the DR DB instance are in the same subnet. You need to select the subnet where the DRS instance resides and ensure that there are available IP addresses. To ensure that the disaster recovery instance is successfully created, only subnets with DHCP enabled are displayed.
IP Address Type
The IP address type of the disaster recovery instance. Only IPv4 and IPv4/IPv6 dual stack are supported.
- IP Address Type can be set to IPv4/IPv6 dual stack only when IPv4/IPv6 dual stack is enabled for the selected VPC and subnet.
- If you select IPv4/IPv6 dual stack and the service or DR database is connected by selecting an instance, DRS preferentially uses an IPv4 address to access the database.
Destination DB Instance Access
Select Read-only.
- During disaster recovery, the entire DR database instance becomes read-only. To change the DR database to Read/Write, you can change the DR database (or destination database) to a service database by clicking Promote Current Cloud on the Disaster Recovery Monitoring tab.
- If a DR task fails, the DR database does not automatically change to the read/write state.
- If a DR task is paused, you can disable read-only for the DR database. For details, see Disabling or Enabling Read-Only.
- After read-only is disabled and the DR task is resumed, the DR database automatically changes to read-only. The read-only settings of the DR DB instance are also affected by the access settings of the DB instance itself. Therefore, you are advised not to set the access settings of the DB instance on the RDS console.
- After the DR task is complete, the DR database changes to Read/Write.
- When the external database functions as the DR database, the user with the superuser permission can set the database to read-only.
- If a DRS instance node is rebuilt due to a fault, to ensure data consistency during the DRS task restoration, the current cloud standby database is set to read-only before the task is restored. After the task is restored, the synchronization relationship recovers.
Enable Binlog Cleanup
This parameter is available when you set Disaster Recovery Relationship to Current cloud as standby. It indicates whether to enable the function of quickly clearing binlogs of the destination database. After this function is enabled, binlog clearing is enabled for the DR database during the full synchronization and disabled during the incremental synchronization.
Specify EIP
This parameter is available when you select Public network for Network Type. Select an EIP to be bound to the DRS instance. DRS will automatically bind the specified EIP to the DRS instance and unbind the EIP after the task is complete. The number of specified EIPs must be the consistent with that of DB instances.
- Specifications
Table 3 Specifications Parameter
Description
AZ
Select the AZ where you want to create the DRS task. Selecting the one housing the source or destination database can provide better performance.
- Tags
Table 4 Tags Parameter
Description
Tags
- Tags a task. This configuration is optional. Adding tags helps you better identify and manage your tasks. Each task can have up to 20 tags.
- If your organization has configured tag policies for DRS, add tags to tasks based on the policies. If a tag does not comply with the policies, task creation may fail. Contact your organization administrator to learn more about tag policies.
- After a task is created, you can view its tag details on the Tags tab. For details, see Tag Management.
If a task fails to be created, DRS retains the task for three days by default. After three days, the task automatically stops.
- Task information description
- On the Configure Source and Destination Databases page, wait until the DR instance is created. Then, specify source and destination database information and click Test Connection for both the source and destination databases to check whether they have been connected to the DR instance. After the connection tests are successful, select the check box before the agreement and click Next.
- Select Current cloud as standby for Disaster Recovery Relationship in 2.
Table 5 Service database settings Parameter
Description
Database Type
By default, Self-built on ECS is selected.
IP Address or Domain Name
The IP address or domain name of the service database.
Port
The port of the service database. Range: 1 – 65535
Database Username
The username for accessing the service database.
Database Password
The password for the service database username. You can change the password if necessary. To change the password, perform the following operation after the task is created:
If the task is in the Starting, Initializing, Disaster recovery in progress, or Disaster recovery failed status, in the Connection Information area on the Basic Information tab, click Modify Connection Details. In the displayed dialog box, change the password.
The IP address, domain name, username, and password of the service database are encrypted and stored in DRS and will be cleared after the task is deleted.
Table 6 DR database settings Parameter
Description
DB Instance Name
The DB instance you selected when creating the DR task and cannot be changed.
Database Username
The username for accessing the DR database.
Database Password
The password for the database username. The password can be changed after a task is created.
If the task is in the Starting, Initializing, Disaster recovery in progress, or Disaster recovery failed status, in the DR Information area on the Basic Information tab, click Modify Connection Details. In the displayed dialog box, change the password.
The database username and password are encrypted and stored in DRS, and will be cleared after the task is deleted.
SSL Connection
If SSL connection is required, enable SSL on the DR database, ensure that related parameters have been correctly configured, and upload an SSL certificate.
NOTE:- The maximum size of a single certificate file that can be uploaded is 500 KB.
- If SSL is disabled, your data may be at risk.
- Select Current cloud as active for Disaster Recovery Relationship in 2.
Table 7 Service database settings Parameter
Description
DB Instance Name
The RDS instance selected when you created the DR task. This parameter cannot be changed.
Database Username
The username for accessing the service database.
Database Password
The password for the database username. You can change the password if necessary. To change the password, perform the following operation after the task is created:
If the task is in the Starting, Initializing, Disaster recovery in progress, or Disaster recovery failed status, in the DR Information area on the Basic Information tab, click Modify Connection Details. In the displayed dialog box, change the password.
The database username and password are encrypted and stored in the system and will be cleared after the task is deleted.
SSL Connection
If SSL connection is required, enable SSL on the service database, ensure that related parameters have been correctly configured, and upload an SSL certificate.
NOTE:- The maximum size of a single certificate file that can be uploaded is 500 KB.
- If SSL is disabled, your data may be at risk.
Table 8 DR database settings Parameter
Description
Database Type
By default, Self-built on ECS is selected.
The destination database can be a Self-built on ECS or an RDS DB instance. If you select RDS DB instance, you need to select the region where the destination database is located.
IP Address or Domain Name
The IP address or domain name of the DR database.
Port
The port of the DR database. Range: 1 – 65535
Region
The region where the RDS DB instance is located. This parameter is available only when the destination database is an RDS DB instance.
DB Instance Name
DR instance name. This parameter is available only when the destination database is an RDS DB instance.
NOTE:When the DB instance is used as the DR database, it is set to read-only. After the task is complete, the DB instance can be readable and writable.
Database Username
Username for logging in to the DR database.
Database Password
Password for the database username.
The IP address, domain name, username, and password of the DR database are encrypted and stored in DRS and will be cleared after the task is deleted.
- Select Current cloud as standby for Disaster Recovery Relationship in 2.
- On the Configure DR page, specify flow control and click Next.
Table 9 DR settings Parameter
Description
Migrate Definer to User
Indicates whether to migrate the Definers of all source database objects to the destination database user entered during the connection test.
- Yes
- No
The Definers of all source database objects will not be changed. You need to migrate all accounts and permissions of the source database in the next step. Note that if the Definer account is not found in the destination database, unavailable objects will be created.
- On the Check Task page, check the DR task.
- If any check fails, review the failure cause and rectify the fault. After the fault is rectified, click Check Again.
- If the check is complete and the check success rate is 100%, go to the Compare Parameter page.
You can proceed to the next step only when all checks are successful. If there are any items that require confirmation, view and confirm the details first before proceeding to the next step.
- On the Confirm Task page, specify Start Time. After confirming that the configured information about the DR task is correct, click Submit.
Table 10 Task settings Parameter
Description
Start Time
Set Start Time to Start upon task creation or Start at a specified time based on site requirements.
NOTE:Starting a DR task may slightly affect the performance of the service and DR databases. You are advised to start a DR task during off-peak hours.
- After the task is submitted, view and manage it on the Disaster Recovery Management page.
- You can view the task status. For more information about task status, see Task Statuses.
- You can click
in the upper-right corner to view the latest task status.
- By default, DRS retains a task in the Configuration state for three days. After three days, DRS automatically deletes background resources, but the task status remains unchanged. When you reconfigure the task, DRS applies for resources again.
- For a public network task, DRS needs to delete background resources after you stop the task. The EIP bound to the task cannot be restored to the Unbound state until background resources are deleted.
- For a task that is in the Disaster recovery in progress state, you can use data comparison to check whether data is consistent before and after the disaster recovery.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot