DTS provides an incremental data subscription feature for RDS MySQL. To subscribe to and consume incremental data, follow these steps:
- On the DTS console, create the subscription channel for RDS instances.
- Use the SDK provided by DTS to connect to the subscription channel to subscribe to and consume the incremental data.
This topic describes the procedure for creating a subscription channel on the DTS console.
Buy a subscription channel.
Log on to the DTS Console and enter the data subscription page.
Click Create data subscription in the upper-right corner of the page.
You need to purchase a subscription channel so that you can configure it. Data subscription now supports Subscription and Pay-As-You-Go billing methods. You can select the one you need.
Set the following parameters on the purchase page:
- Source instance region
The region where the source RDS instance of the subscription channel is located.
The quantity is the number of subscription channels purchased at a time. If you select a pay-as-you-go instance, the most you can purchase is 99 links at a time.
After the subscription channel is purchased, return to the DTS Console, click Configure Subscription Channel on the right of the newly purchased link to start configuring links.
Configure the RDS instance
- Channel name
The channel name does not have to be unique. For the convenience of identifying a specific channel, we recommend that you use an informative name that is easy to identify.
- The RDS instance ID of the subscription channel.
Select an RDS instance you want to subscribe to. Only the RDS for MySQL instances under your Alibaba Cloud account are shown in the drop-down list.
After you configure the preceding settings, you can click Authorize whitelist and enter into next step in the lower-right corner.
Configure the RDS instance whitelist.
Add the IP address of the data transmission server to the whitelist of the RDS instance for subscription. You can avoid errors in creating subscription channels caused by the data transmission server failing to connect to the RDS due to RDS whitelist restrictions.
To guarantee subscription channel stability, do not delete these server IP addresses from the whitelists of the RDS instances during the subscription.
After the whitelist is configured, click Next to create the synchronization account.
4.Select a subscription object
In this step, you need to select the objects to be subscribed to.
The subscription objects that DTS supports are databases and tables. You can subscribe to specific databases or tables.
The subscription data types that DTS supports are data change and schema change. If subscription object and data change are selected, only three kinds of data changes, namely insert, delete and update, can be subscribed to. If you want to subscribe to schema change (DDL), select schema change as the subscription data type. If you subscribe to schema change, DTS lists all the schema changes in the RDS instance. You need to filter the data by using the SDK.
After subscription objects have been selected, DTS performs a pre-check before starting the subscription channel.
After the subscription channel is configured, DTS performs a pre-check. After the pre-check is successful, click Subscribe to start the subscription channel.
6.Start the subscription.
DTS takes about one minute to initialize the subscription channel you have created. After the initialization is complete, you can view subscribed data online or subscribe to the incremental data by using the SDK.