Troubleshoot issues with change tracking tasks

更新时间:
复制 MD 格式

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.

Important

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

  1. Download the dts_subscribe_sdk_dep_demo toolkit to the client and decompress it.

  2. Modify the config configuration file by configuring the parameters described in the following table.

    Table 1. Required parameters

    Parameter

    Description

    Source

    brokerUrl

    The endpoint and port number of the Data Subscription channel.

    Note

    If 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.

    topic

    The 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.

    sid

    The 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.

    Note

    This is the password that you set when you created the consumer group.

    userName

    The account of the consumer group.

    Warning

    If 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.

    password

    The password for the account.

    initCheckpoint

    The starting consumer offset, specified as a Unix timestamp (e.g., 1620962769).

    Important
    • This parameter takes effect only when subscribeMode is set to ASSIGN and isForceUseInitCheckpoint is 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.

    Note

    You can use a search engine to find a Unix timestamp converter tool.

    subscribeMode

    The 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

    isForceUseInitCheckpoint

    Specifies whether to force the subscription to start from the initCheckpoint offset. Valid values are true and false.

    N/A

  3. Copy the config file to the same directory as the toolkit.

  4. Run the following command in the toolkit directory.

    java -jar dts_subscribe_sdk_dep_demo-1.0-SNAPSHOT-jar-with-dependencies.jar config

  5. 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 brokerUrl is incorrect or unreachable, causing a connection failure.

    Enter the correct brokerUrl in the config file.

    telnet real node xxx failed, please check the network

    A network error prevents the client from connecting to a DTS broker node.

    Verify that the brokerUrl is 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 userName and password in the config file.

    com.aliyun.dts.subscribe.clients.exception.TimestampSeekException: RecordGenerator:seek timestamp for topic [cn_hangzhou_rm_bp11tv2923n87081s_rdsdt_dtsacct-0] with timestamp [1610249501] failed

    The consumer offset is outside the specified range, causing a connection failure.

    In the config file, set the initCheckpoint parameter to a value within the subscription instance's data range.

    Note

    If the values of the DStoreRecordQueue and DefaultUserRecordQueue message 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.