Failed to Import MySQL Data into TiDB Using DM

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 用dm把mysql的数据导入tidb失败

| username: 灰太狼来了

After executing the following command, I found that there is no MySQL database in TiDB:

[tidb@localhost ~]$ tiup dmctl --master-addr 192.168.100.77:8261 start-task testdm-task.yaml
tiup is checking updates for component dmctl ...timeout(2s)!
Starting component `dmctl`: /home/tidb/.tiup/components/dmctl/v6.6.0/dmctl/dmctl --master-addr 192.168.100.77:8261 start-task testdm-task.yaml
{
    "result": true,
    "msg": "",
    "sources": [
        {
            "result": true,
            "msg": "",
            "source": "mysql-01",
            "worker": "dm-192.168.100.77-8262"
        }
    ],
    "checkResult": "pre-check is passed. "
}
[tidb@localhost ~]$ tiup dmctl --master-addr 192.168.100.77:8261 query-status testdm
tiup is checking updates for component dmctl ...timeout(2s)!
Starting component `dmctl`: /home/tidb/.tiup/components/dmctl/v6.6.0/dmctl/dmctl --master-addr 192.168.100.77:8261 query-status testdm
{
    "result": true,
    "msg": "",
    "sources": [
        {
            "result": true,
            "msg": "",
            "sourceStatus": {
                "source": "mysql-01",
                "worker": "dm-192.168.100.77-8262",
                "result": null,
                "relayStatus": null
            },
            "subTaskStatus": [
                {
                    "name": "testdm",
                    "stage": "Running",
                    "unit": "Sync",
                    "result": null,
                    "unresolvedDDLLockID": "",
                    "sync": {
                        "totalEvents": "2",
                        "totalTps": "0",
                        "recentTps": "0",
                        "masterBinlog": "(binfile.000002, 48060270)",
                        "masterBinlogGtid": "",
                        "syncerBinlog": "(binfile.000002, 48060270)",
                        "syncerBinlogGtid": "",
                        "blockingDDLs": [
                        ],
                        "unresolvedGroups": [
                        ],
                        "synced": true,
                        "binlogType": "remote",
                        "secondsBehindMaster": "0",
                        "blockDDLOwner": "",
                        "conflictMsg": "",
                        "totalRows": "0",
                        "totalRps": "0",
                        "recentRps": "0"
                    },
                    "validation": null
                }
            ]
        }
    ]
}
| username: magic | Original post link

Is your DM version different from your cluster version?
Check if the metadata files in the data directory are complete.

| username: 灰太狼来了 | Original post link

Can you help me check if there is a problem with my version? I don’t quite understand it.

[tidb@localhost ~]$ tiup --version
1.11.3 tiup
Go Version: go1.19.5
Git Ref: v1.11.3
GitHash: 7223ed50460785a2adf666d511a257aa03110294
[tidb@localhost ~]$ tiup cluster --version
tiup is checking updates for component cluster ...
A new version of cluster is available:
   The latest version:         v1.11.3
   Local installed version:    v1.11.1
   Update current component:   tiup update cluster
   Update all components:      tiup update --all

Starting component `cluster`: /home/tidb/.tiup/components/cluster/v1.11.1/tiup-cluster --version
tiup version 1.11.1 tiup
Go Version: go1.19.2
Git Ref: v1.11.1
GitHash: b95172df211e4f9b643590f2dd8436ad60c72b38
[tidb@localhost ~]$ tiup dm --version
tiup is checking updates for component dm ...
Starting component `dm`: /home/tidb/.tiup/components/dm/v1.11.3/tiup-dm --version
tiup version 1.11.3 tiup
Go Version: go1.19.5
Git Ref: v1.11.3
GitHash: 7223ed50460785a2adf666d511a257aa03110294
[tidb@localhost ~]$ 

| username: 考试没答案 | Original post link

What error is it reporting exactly???

| username: 考试没答案 | Original post link

tiup cluster list — View cluster version
tiup dm list — View DM version

| username: 考试没答案 | Original post link

Please provide the detailed error logs. The more detailed, the better.

| username: 灰太狼来了 | Original post link

I’ll try changing the versions of DM and TiDB to be consistent. Thank you.

| username: 考试没答案 | Original post link

Inconsistencies can lead to many strange and unusual problems. Let’s aim for consistency.

| username: 考试没答案 | Original post link

No problem, just read the official documentation. Your questions can all be resolved by the official documentation. It’s a suggestion.

| username: 灰太狼来了 | Original post link

Is there no version 5.0.0 for DM?

[tidb@localhost ~]$ tiup cluster list
tiup is checking updates for component cluster ...
A new version of cluster is available:
   The latest version:         v1.11.3
   Local installed version:    v1.11.1
   Update current component:   tiup update cluster
   Update all components:      tiup update --all

Starting component `cluster`: /home/tidb/.tiup/components/cluster/v1.11.1/tiup-cluster list
Name       User  Version  Path                                                 PrivateKey
----       ----  -------  ----                                                 ----------
tidb-test  tidb  v5.0.0   /home/tidb/.tiup/storage/cluster/clusters/tidb-test  /home/tidb/.tiup/storage/cluster/clusters/tidb-test/ssh/id_rsa
[tidb@localhost ~]$ tiup dm list
tiup is checking updates for component dm ...
Starting component `dm`: /home/tidb/.tiup/components/dm/v1.11.3/tiup-dm list
Name     User  Version  Path                                          PrivateKey
----     ----  -------  ----                                          ----------
dm-test  tidb  v6.0.0   /home/tidb/.tiup/storage/dm/clusters/dm-test  /home/tidb/.tiup/storage/dm/clusters/dm-test/ssh/id_rsa
[tidb@localhost ~]$ 
[tidb@localhost ~]$ 
[tidb@localhost ~]$ 
[tidb@localhost ~]$ 
[tidb@localhost ~]$ tiup uninstall dmctl --all
Uninstalled component `dmctl` successfully!
[tidb@localhost ~]$ tiup install dmctl:v5.0.0
Error: version v5.0.0 on linux/amd64 for component dmctl not found: unknown version
[tidb@localhost ~]$ tiup install dmctl:5.0.0
Error: version 5.0.0 on linux/amd64 for component dmctl not found: unknown version
[tidb@localhost ~]$ 
| username: 考试没答案 | Original post link

I remember upgrading doesn’t require uninstalling, right?

Did you install a lower version??

| username: 考试没答案 | Original post link

This is your current version. What is your TiDB version?

| username: 考试没答案 | Original post link

It is also possible that it is not a version issue. Please investigate the specific cause.

| username: 灰太狼来了 | Original post link

I’m having a really hard time. Someone asked me to uninstall and reinstall version 5.0.0, so I did. My TiDB version is 5.0.0. Now I’ve reinstalled DM, and the version is 6.0.0. How can I change DM to version 5.0.0 as well? I can’t see the logs or any errors for the specific reason.

| username: magic | Original post link

I accidentally deleted a reply just now.
tiup list dmctl lists the available versions of dmctl, which are generally unified with dm. Additionally, the dm version is specified during deployment as follows:

tiup dm deploy dm-test ${version} ./topology.yaml --user root [-p] [-i /home/root/.ssh/gcp_rsa]
| username: 考试没答案 | Original post link

Add this parameter to the task and see if the data exported by Dumpling has any issues.

| username: 考试没答案 | Original post link

Also, clear the relevant content of the metadata database dm_meta for this task, and then rerun it to see.

| username: 灰太狼来了 | Original post link

I added this parameter and then ran it again. How do I view the data produced by Dumpling?

| username: 考试没答案 | Original post link

In the worker directory

| username: 灰太狼来了 | Original post link

I found that databases named “sys” cannot be synchronized, but databases with other names can be synchronized.