Creating a Synchronization Task
This section describes how to synchronize data from MySQL databases to RDS MySQL databases. To configure other storage engines, you can refer to the following procedures.
Prerequisites
- You have logged in to the DRS console.
- Your account balance is greater than or equal to ¥0.
- The database you want to synchronize meets the database type requirements. For details, see Real-Time Synchronization.
- The constraints on data synchronization are met. For details, see Before You Start.
Procedure
- On the Data Synchronization Management page, click Create Synchronization Task.
- On the Select Scenario page, select Source Database Type and Destination Database Type and click Next.
- To the cloud: The source database can be Databases on the current cloud, On-premises databases, Self-built databases on ECS, or Databases on other cloud. The destination database can be Databases on the current cloud.
- Out of the cloud: the source database can be Databases on the current cloud. The destination database can be On-premises databases, Self-built databases on ECS, Databases on the current cloud, or Databases on other cloud.
- On the Create Synchronization Instance page, configure the task details, recipients, description, and the synchronization instance, and click Next. Figure 1 Synchronization task information
Table 1 Task and recipient description Parameter
Description
Task Name
The task name consists of 4 to 50 characters, starts with a letter, and can contain only letters (case-insensitive), digits, hyphens (-), and underscores (_).
Send Notifications
(Optional) If this function is enabled, DRS will send notifications to specified recipients based on the mobile numbers and email addresses you set. If an exception occurs during synchronization, the system will send a notification to the specified recipients.
NOTE:Recipients must confirm the subscription on the SMN console within 48 hours of receiving an SMS message or email. Otherwise, they cannot receive notifications from DRS.
Task Inheritance
(Optional) If this function is enabled, enter the ID of the task to be inherited and verify the ID. After the inherited task takes effect, it will continue the original task. An inherited task can be in the Failed, Pause, or Deleted state. A running task cannot be inherited.
NOTE:Only Oracle to MRS Kafka synchronization supports this function.
Synchronization Delay Threshold
During an incremental synchronization, a synchronization delay indicates a time difference (in seconds) of synchronization between the source and destination database.
If the synchronization delay exceeds the threshold you specify, DRS will send alarms to the specified recipients. The value ranges from 1 to 3,600. To avoid repeated alarms caused by the fluctuation of delay, an alarm is sent only after the delay has exceeded the threshold for six minutes.
NOTE:- In the early stages of an incremental synchronization, the synchronization delay is long because a large quantity of data is awaiting synchronization. In this case, no notifications will be sent.
- Before setting the delay threshold, you need to enter the recipient's mobile number or email address.
Description
The description consists of a maximum of 256 characters and cannot contain the following special characters: !=<>'&"
Figure 2 Synchronization instance information
Table 2 Synchronization instance information Parameter
Description
Data Flow
Select To the cloud. The destination database is Databases on the current cloud.
Source DB Engine
Select MySQL.
Destination DB Engine
Select MySQL.
Network Type
The public network is used as an example.
- Available options: Public network, VPC, VPN or Direct Connect
- For synchronizations from PostgreSQL to PostgreSQL, VPC, VPN, and Direct Connect can be used based on service scenarios.
Destination DB Instance
The RDS DB instance you created.
NOTE:- The destination database cannot be a read replica.
- The source and destination DB instances can be the same DB instance.
Synchronization Instance Subnet
Select the subnet where the synchronization instance is located. You can also click View Subnet to go to the network console to view the subnet where the instance resides.
By default, the DRS instance and the destination 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 synchronization instance is successfully created, only subnets with DHCP enabled are displayed.
Synchronization Mode
Full+Incremental
This synchronization mode allows you to synchronize data in real time. After a full synchronization initializes the destination database, an incremental synchronization parses logs to ensure data consistency between the source and destination databases.
NOTE:If you select the Full+Incremental synchronization mode, data generated during the full synchronization will be synchronized to the destination database in real time, ensuring that both the source and destination databases remain accessible.
Tags
This setting is optional. Adding tags helps you better identify and manage your tasks. Each task can have up to 10 tags.
After a task is created, you can view its tag details on the Tags tab. For detailed operations, see Tag Management.
- After the synchronization instance is created, on the Configure Source and Destination Databases page, specify source and destination database information. Then, click Test Connection for both the source and destination databases to check whether they have been connected to the synchronization instance. After the connection tests are successful, select the check box before the agreement and click Next. The information of the source and destination databases to be specified varies depending on the scenario selected in 2.
- To the cloud Figure 3 Source database information
Table 3 Source database information Parameter
Description
IP Address or Domain Name
The IP address or domain name of the source database.
Port
The port of the source database.
Range: 1 - 65535
Database Username
The username for accessing the source 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, full synchronization, incremental synchronization, or incremental synchronization failed state, in the Migration Information area on the Basic Information page, click Update Password next to the Source Database Password field. In the displayed dialog box, change the password.
SSL Connection
SSL encrypts the connections between the source and destination databases. If SSL is enabled, upload the SSL CA root certificate.
NOTE:- The maximum size of a single certificate file that can be uploaded is 500 KB.
- If the SSL certificate is not used, your data may be at risk.
- The IP address, domain name, username, and password of the source database are encrypted and stored in DRS, and will be cleared after the task is deleted.
Figure 4 Destination database information
Table 4 Destination database information Parameter
Description
DB Instance Name
The RDS DB instance you selected when creating the migration task and cannot be changed.
Database Username
The username for accessing the destination database.
Database Password
The password for the database username. The database username and password are encrypted and stored in the system, and will be cleared after the task is deleted. 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, Full synchronization, Incremental synchronization, or Incremental synchronization failed status, in the Synchronization Information area on the Basic Information page, click Update Password next to the Destination Database Password field. In the displayed dialog box, change the password. This action only updates DRS with the changed password.
- Out of the cloud Figure 5 Source database information
Table 5 Source database information Parameter
Description
DB Instance Name
By default, this parameter is set to the cloud DB instance you have selected when you create the task and cannot be changed.
Database Username
The username for accessing the source database.
Database Password
The password for the database username. The database username and password are encrypted and stored in the system, and will be cleared after the task is deleted. 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, Full synchronization, Incremental synchronization, or Incremental synchronization failed status, in the Synchronization Information area on the Basic Information page, click Update Password next to the Source Database Password field. In the displayed dialog box, change the password. This action only updates DRS with the changed password.
Figure 6 Destination database information
Table 6 Destination database information Parameter
Description
IP Address or Domain Name
The IP address or domain name of the destination database.
Port
The port of the destination database.
Range: 1 - 65535
Database Username
The username for accessing the destination database.
Database Password
The password for the database username. The password can be changed after a task is created. During Oracle to MRS Kafka synchronization, you can change the IP address, domain name, port number, and database username.
If the task is in the Starting, Full synchronization, Incremental synchronization, or Incremental synchronization failed status, in the Synchronization Information area on the Basic Information page, click Update Password next to the Destination Database Password field. In the displayed dialog box, change the password. This action only updates DRS with the changed password.
If an Oracle to MRS Kafka synchronization task is in the Incremental synchronization failed status, in the Synchronization Information area on the Basic Information page, click Update Password next to the Destination Database Password field. In the displayed dialog box, change the IP address/domain name, port, or database username.
The database username and password are encrypted and stored in the system, and will be cleared after the task is deleted.
SSL Connection
SSL encrypts the connections between the source and destination databases. If SSL is enabled, upload the SSL CA root certificate.
NOTE:The maximum size of a single certificate file that can be uploaded is 500 KB.
- To the cloud
- On the Set Synchronization Task page, select the data synchronization type, conflict policy, and synchronization object, and then click Next. Figure 7 Synchronization mode
Table 7 Synchronization mode and object Parameter
Description
Conflict Policy
NOTE:Oracle to RDS MySQL synchronization does not support conflict policies.
The data synchronization function provides conflict policies for you to choose from if the synchronized data conflicts with existing data (such as the source and destination databases containing the same primary or unique keys) in the destination database.
Select any of the following conflict policies:
- Ignore
The system will skip the conflicting data and continue the subsequent synchronization process.
- Report error
- Overwrite
Conflicting data will be overwritten.
NOTE:Only the MySQL to RDS MySQL synchronization supports the overwrite policy.
If data conflicts occur, you can select Ignore, Overwrite, or Report error.
- Data exists in the destination database.
- Multiple source databases are synchronized to one destination database.
- Data in the destination database is updated manually.
Filter DROP DATABASE
During synchronization, executing DDL operations on the source database may affect data synchronization. To reduce the risks involved in data synchronization, DDL operations can be filtered. That means that you can choose not to synchronize certain DDL operations.
The database deletion operation can be filtered by default.
- If you select Yes, the database deletion operation performed on the source database is not synchronized during data synchronization.
- If you select No, related operations are synchronized to the destination database during data synchronization. NOTE:
Only the following synchronization scenarios support DDL operations:
- MySQL database -> RDS MySQL DB instance
- MySQL database -> RDS PostgreSQL DB instance
- MySQL database -> GaussDB(openGauss) instance
- DDM instance -> RDS MySQL DB instance
- DDM instance -> DWS
- RDS MySQL DB instance -> MySQL database
Synchronize
Supports index synchronization. You can determine whether to synchronize indexes based on the service requirements.
Synchronization Object
DRS supports database- and table-level synchronization. You can select data for synchronization based on your service requirements. If the source database is changed, click
in the upper right corner before selecting synchronization objects to ensure that the objects to be selected are from the changed source database.- MySQL to MySQL synchronization supports database-level and table-level synchronization.
- MySQL to PostgreSQL synchronization supports table-level synchronization.
- PostgreSQL to PostgreSQL synchronization supports database-level synchronization.
- Oracle to MySQL synchronization supports table-level synchronization.
- DDM to DWS synchronization supports database-level and table-level synchronization.
- DDM to Oracle synchronization supports database-level and table-level synchronization.
Data synchronization allows you to synchronize objects (including databases, schemas and tables) in a sources database to the corresponding objects in a destination database. If the synchronization objects in source and destination databases have different names, you can map the source object name to the destination one. The object types that can be mapped include database, schema, and table.
For details about how to map object names, see Mapping Object Names in the Data Replication Service User Guide.
- Ignore
- On the Process Data page, set the filtering rules for data processing.
- If you do not need to set a processing rule, select No processing and click Next.
- If you need to set a processing rule, select Data filtering and set the filtering rule by referring to Processing Data.
Figure 8 Processing data
- On the Check Task page, check the synchronization task.
- If any check fails, review the failure cause and rectify the fault. After the fault is rectified, click Check Again.
For details about how to handle check failures, see the Checking Whether the Source Database Is Connected section in the Data Replication Service User Guide.
- If all check items are successful, click Next. Figure 9 Task Check
You can proceed to the next step only when all check items are successful. If any alarms are generated, view and confirm the alarm details first before proceeding to the next step.
- If any check fails, review the failure cause and rectify the fault. After the fault is rectified, click Check Again.
- On the Confirm Task page, specify Start Time, confirm that the configured information is correct, select the check box before the agreement, and click Next.
- Set Start Time to Start upon task creation or Start at a specified time based on site requirements.
- After a synchronization task is started, the performance of the source and destination databases may be affected. You are advised to start a synchronization task during off-peak hours.
- After the task is submitted, you can view and manage it on the Data Synchronization Management page.
- You can view the task status. For more information about task status, see Task Status.
- You can click
in the upper-right corner to view the latest task status.
Last Article: Before You Start
Next Article: Viewing the Synchronization Progress
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.