This topic describes how to troubleshoot issues with the new version of change tracking tasks by using a dedicated Data Transmission Service (DTS) toolkit on your change tracking client.
Background information
It is difficult to troubleshoot issues with change tracking tasks in the following scenarios: tracked data is consumed without using SDKs, lots of changes are made to SDKs, and the change tracking client runs in different environments. DTS provides a toolkit to help troubleshoot issues with your change tracking tasks.
Using this toolkit updates the consumer offset of the specified consumer group in the console. The server-side consumer offset, which the SUBSCRIBE mode uses, is not updated.
Prerequisites
Java Development Kit (JDK) is installed on your change tracking client. We recommend that you install JDK 1.8 or later.
Procedure
-
Download the dts_subscribe_sdk_dep_demo toolkit to the client and decompress it.
-
Modify the config configuration file by configuring the parameters described in the following table.
Table 1. Required parameters Parameter
Description
Source
brokerUrlThe endpoint and port number of the Data Subscription channel.
NoteIf the ECS instance where your SDK client is deployed is in the same VPC as the Data Subscription channel, use the private IP address for the subscription to minimize network latency.
In the DTS console, click the ID of the target subscription instance. On the Basic Information page, in the Network area, you can obtain the endpoint and port number.
topicThe topic of the Data Subscription channel.
In the DTS console, click the ID of the target subscription instance. On the Basic Information page, in the Basic Information section, you can obtain the Topic.
sidThe consumer group ID.
In the DTS console, click the ID of the target subscription instance and then click the Consume Data tab on the left. You can obtain the Consumer Group ID and the Account information.
NoteThis is the password that you set when you created the consumer group.
userNameThe account of the consumer group.
WarningIf you are not using the client provided in this topic, you must set the username in the format of
<Consumer group account>-<Consumer group ID>, for example,dtstest-dtsae******bpv. Otherwise, the connection fails.passwordThe password for the account.
initCheckpointThe starting consumer offset, specified as a Unix timestamp (e.g., 1620962769).
Important-
This parameter takes effect only when
subscribeModeis set to ASSIGN andisForceUseInitCheckpointis set to true. -
You can use the consumer offset for the following purposes:
-
To prevent data loss after a business process is interrupted, pass the last consumer offset to resume data consumption.
-
When starting the subscription client, pass the desired consumer offset to adjust the subscription starting point and consume data on demand.
-
In the DTS console, on the Change Tracking tab, view the Data Range of the target instance. The consumer offset must be within the data range of the subscription instance and must be converted to a Unix timestamp.
NoteYou can use a search engine to find a Unix timestamp converter tool.
subscribeModeThe operating mode of the SDK client. Valid values are:
-
ASSIGN: In this mode, only one SDK client per consumer group can consume subscription data.
-
SUBSCRIBE: In this mode, you can start multiple SDK clients in the same consumer group for disaster recovery.
N/A
isForceUseInitCheckpointSpecifies whether to force the subscription to start from the
initCheckpointoffset. Valid values are true and false.N/A
-
-
Copy the
configfile to the same directory as the toolkit. -
Run the following command in the toolkit directory.
java -jar dts_subscribe_sdk_dep_demo-1.0-SNAPSHOT-jar-with-dependencies.jar config -
View the dts-new-subscribe.log log file in the directory in which the command is run. Refer to the following table to troubleshoot issues.
Log information
Description
Solution
[2022-01-04 17:10:53.949] [INFO ] [com.aliyun.dts.subscribe.clients.recordprocessor.EtlRecordProcessor] [com.aliyun.dts.subscribe.clients.recordprocessor.DefaultRecordPrintListener:49] - RecordID [13082769] RecordTimestamp [1641284702] Source [{"sourceType": "MySQL", "version": "5.6.16-log"}] RecordType [HEARTBEAT]Indicates that the subscription task is running correctly.
N/A
ERROR CheckResult{isOk=false, errMsg='telnet dts-cn-hangzhou.aliyuncs.com:18009 failed, please check the network and if the brokerUrl is correct'} (com.aliyun.dts.subscribe.clients.DefaultDTSConsumer)The
brokerUrlis incorrect or unreachable, causing a connection failure.Enter the correct
brokerUrlin theconfigfile.telnet real node xxx failed, please check the networkA network error prevents the client from connecting to a DTS broker node.
Verify that the
brokerUrlis correct and that no firewalls are blocking the connection from your client to the endpoint.ERROR CheckResult{isOk=false, errMsg='build kafka consumer failed, error: org.apache.kafka.common.errors.TimeoutException: Timeout expired while fetching topic metadata, probably the user name or password is wrong'} (com.aliyun.dts.subscribe.clients.DefaultDTSConsumer)The username or password is incorrect, causing a connection failure.
Enter the correct
userNameandpasswordin theconfigfile.com.aliyun.dts.subscribe.clients.exception.TimestampSeekException: RecordGenerator:seek timestamp for topic [cn_hangzhou_rm_bp11tv2923n87081s_rdsdt_dtsacct-0] with timestamp [1610249501] failedThe consumer offset is outside the specified range, causing a connection failure.
In the
configfile, set theinitCheckpointparameter to a value within the subscription instance's data range.NoteIf the values of the
DStoreRecordQueueandDefaultUserRecordQueuemessage queue parameters consistently remain at 0, it indicates a bottleneck when retrieving data from the DTS server. If their values consistently remain at the default of 512, it indicates that the subscription client is consuming subscription data slowly.