You can use the change tracking feature of Data Transmission Service (DTS) to subscribe to incremental data from a PolarDB for MySQL cluster in real time. This helps you implement lightweight cache updates, enable asynchronous business decoupling, and perform real-time data synchronization with ETL logic. This topic shows how to create a change tracking channel for PolarDB for MySQL.
Prerequisites
The binary logging feature is enabled for the source PolarDB for MySQL cluster. For more information, see Enable binary logging.
Usage notes
- Online DDL changes by tools such as gh-ost or pt-online-schema-change are not tracked. The client may fail to write consumed data to the destination table due to schema mismatches.
- If the source database is used in another task such as data migration, data outside your subscription scope may be tracked. Filter unwanted data in your client application.
Procedure
- Purchase a change tracking channel. For more information, see Purchase a change tracking task. Note When you purchase the channel, set Source database to PolarDB and select the region where the source PolarDB for MySQL cluster is located.
- Log on to the DTS console.
- In the left-side navigation pane, click Change Tracking.
- On the Change Tracking Tasks page, select the region of your change tracking instance.
- Find the purchased channel and click Configure channel.
- Configure the source database information and network type.
Section Parameter Description N/A Task name DTS automatically generates a task name. We recommend specifying an informative name for easy identification. The name does not need to be unique. Source database Instance type This is set to PolarDB instance and cannot be changed. Database type This is set to PolarDB and cannot be changed. Instance region The source region you selected when purchasing the channel. This parameter cannot be changed. PolarDB instance ID Select the ID of the source PolarDB for MySQL cluster. Database account Enter the database account of the source PolarDB for MySQL cluster. Note The account must have the REPLICATION CLIENT, REPLICATION SLAVE, SHOW VIEW, and SELECT permissions on the subscription objects.Database password Enter the password for the database account. Network type N/A Specify the network type for the channel. -
Classic Network
If you set the network type to Classic Network, no other configuration is needed. What is a classic network?.
-
Proprietary Network
If you set the network type to Proprietary Network, you must also select a Proprietary Network and a vSwitch. What is a VPC?.
Note-
Select the same network type as the ECS instance where your subscription client is deployed. For example, if the ECS instance is in a VPC, select VPC as the network type and specify the Proprietary Network and vSwitch.
-
Private network connections minimize latency.
-
- Click Set whitelist and next.
DTS automatically adds the IP addresses of DTS servers in the corresponding region to the whitelist of the Alibaba Cloud database instance. For a list of DTS server IP addresses, see IP address ranges of DTS servers.
Warning Adding public CIDR blocks poses security risks. Use strong passwords, restrict open ports, authenticate internal APIs, review network access regularly, and use private connections through Express Connect, VPN Gateway, or Smart Access Gateway. - Configure the data types and objects to track.
- Click Save and Precheck. Note
- The task can start only after it passes a precheck.
- If the precheck fails, click
- When the Precheck Passed message appears in the Precheck dialog box, close the Precheck dialog box.
Next steps
After configuration, the channel initializes for about one minute. Once initialization is complete, you can perform the following operations: