A complete real-time synchronization consists of creating a synchronization task, tracking task progress, analyzing synchronization logs, and comparing data consistency. By comparing multiple items and data, you can synchronize data between different service systems in real time.
A complete real-time synchronization involves the following procedures.
This section describes how to synchronize data from a MySQL database to an RDS MySQL database. To configure other storage engines, you can refer to the following procedures.
Parameter |
Description |
---|---|
Region |
The region where the synchronization instance is deployed. You can change the region. |
Project |
The project corresponds to the current region and can be changed. |
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 !=<>'&"\ |
Parameter |
Description |
---|---|
Data Flow |
Select To the cloud. The destination database is a database in 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 |
Destination DB Instance |
The RDS DB instance you created. NOTE:
|
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 |
Available options: Full+Incremental and Incremental
|
Parameter |
Description |
---|---|
Tags |
|
If a task fails to be created, DRS retains the task for three days by default. After three days, the task automatically ends.
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. 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. |
SSL Connection |
SSL encrypts the connections between the source and destination databases. If SSL is enabled, upload the SSL CA root certificate. This parameter is unavailable when the network type is VPC network and the database type is RDS DB instance. NOTE:
|
The IP address, port, username, and password of the source database are encrypted and stored in the database and the synchronization instance, and will be cleared after the task is deleted.
Parameter |
Description |
---|---|
DB Instance Name |
The RDS DB instance selected during synchronization task creation. This parameter cannot be changed. |
Database Username |
The username for accessing the destination 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, 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. |
The username and password of the destination database are encrypted and stored in the database and the synchronization instance during the synchronization. After the task is deleted, the username and password are permanently deleted.
Parameter |
Description |
---|---|
Flow Control |
You can choose whether to control the flow.
|
Incremental Conflict Policy |
The conflict policy refers to the conflict handling policy during incremental synchronization. By default, conflicts in the full synchronization phase are ignored. Select any of the following conflict policies:
If data conflicts occur, you can select Ignore, Overwrite, or Report error in any of the following scenarios.
|
Filter DROP DATABASE |
During real-time synchronization, executing DDL operations on the source database may affect the synchronization performance. To reduce the risk of synchronization failure, DRS allows you to filter out DDL operations. Currently, only the delete operations on databases can be filtered by default.
|
Synchronize |
Normal indexes and incremental DDLs can be synchronized. You can determine whether to synchronize data based on service requirements. |
Start Point |
This option is available if you select Incremental in 2. The logs of the source database are obtained from the start point during an incremental synchronization. Run show master status to obtain the source database position and set File, Position, and Executed_Gtid_Set as prompted. If gtid_mode is disabled, you do not need to specify Executed_Gtid_Set. |
Synchronization Object |
Select Tables or Databases as required.
NOTE:
|
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.
Parameter |
Description |
---|---|
Started Time |
Set Start Time to Start upon task creation or Start at a specified time based on site requirements. NOTE:
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. |