DM同步数据时查询状态报mydumper错误

query-status test { “result”: true, “msg”: “”, “workers”: [ { “result”: true, “worker”: “192.168.15.118:8262”, “msg”: “”, “subTaskStatus”: [ { “name”: “test”, “stage”: “Paused”, “unit”: “Dump”, “result”: { “isCanceled”: false, “errors”: [ { “Type”: “UnknownError”, “msg”: “[code=32001:class=dump-unit:scope=internal:level=high] mydumper runs with error: exit status 1. \n\n”, “error”: null } ], “detail”: null }, “unresolvedDDLLockID”: “”, “dump”: {

                }
            }
        ],
        "relayStatus": {
            "masterBinlog": "(mysql-bin.000347, 194)",
            "masterBinlogGtid": "52a09316-e094-11e7-b73d-ac1f6b19cd2e:1-168206863",
            "relaySubDir": "52a09316-e094-11e7-b73d-ac1f6b19cd2e.000001",
            "relayBinlog": "(mysql-bin.000347, 194)",
            "relayBinlogGtid": "",
            "relayCatchUpMaster": true,
            "stage": "Running",
            "result": null
        },
        "sourceID": "mysql-replica-01"
    }
]

}

你好,

  1. 执行 show-ddl-locks [--worker=127.0.0.1:8262] [task-name] 看下

  2. 请将完整的 query-status taskname 上传下

按照你说的,执行了show-ddl-locks » unlock-ddl-lock Usage: dmctl unlock-ddl-lock [-w worker …] [flags]

Flags: -f, --force-remove force to remove DDL lock -h, --help help for unlock-ddl-lock -o, --owner string DM-worker to replace the default owner

Global Flags: -w, --worker strings DM-worker ID » show-ddl-locks { “result”: true, “msg”: “no DDL lock exists”, “locks”: [ ] }

以下是查询task status » query-status test { “result”: true, “msg”: “”, “workers”: [ { “result”: true, “worker”: “192.168.15.118:8262”, “msg”: “”, “subTaskStatus”: [ { “name”: “test”, “stage”: “Paused”, “unit”: “Dump”, “result”: { “isCanceled”: false, “errors”: [ { “Type”: “UnknownError”, “msg”: “[code=32001:class=dump-unit:scope=internal:level=high] mydumper runs with error: exit status 1. \n\n”, “error”: null } ], “detail”: null }, “unresolvedDDLLockID”: “”, “dump”: {

                }
            }
        ],
        "relayStatus": {
            "masterBinlog": "(mysql-bin.000347, 194)",
            "masterBinlogGtid": "52a09316-e094-11e7-b73d-ac1f6b19cd2e:1-168206863",
            "relaySubDir": "52a09316-e094-11e7-b73d-ac1f6b19cd2e.000001",
            "relayBinlog": "(mysql-bin.000347, 194)",
            "relayBinlogGtid": "",
            "relayCatchUpMaster": true,
            "stage": "Running",
            "result": null
        },
        "sourceID": "mysql-replica-01"
    }
]

}

能加一下微信指导一下我么,liuh18600

» show-ddl-locks { “result”: true, “msg”: “no DDL lock exists”, “locks”: [ ] }

你好,

如果可以的话,给上游 mydumper 加上 reload 权限

如果不行就加 --no-locks

你看一下啊,我这个task有问题么?

你好,

目测缩进有些问题,建议使用空格进行缩进,不用时要 tab ,如果格式确实不知道如何调整,可以上传下 yaml 文件,

可以使用在线校验工具,看下 yaml 格式是否正常

https://www.bejson.com/validators/yaml_editor/

task_test.yaml (696 字节)

name: test
task-mode: all
meta-schema: "dm_meta"
remove-meta: false

target-database:
  host: "192.168.15.115"
  port: 4000
  user: "root"
  password: "dkkA6f2wZ9swQVaObwmMM0BDvAo7Ew0="
mysql-instances:
  -
    source-id: "mysql-replica-01"
    black-white-list: "global"
    mydumper-config-name: "global"

black-white-list:
  global:
    do-tables:
    - db-name: "temp-db-lh"
      tbl-name: "inv_fp_kj"
mydumpers:
  global:
    mydumper-path: "./bin/mydumper"
    threads: 4
    chunk-filesize: 64
    skip-tz-utc: true
    extra-args: "--no-locks"

这么写,怎么同步到下游的某个库里对应的表中呢?

你好,

默认上下游想用,如果有需要路由可以使用,可以说下你的需求,如果尝试写不通可以发帖提问

mysql-instances:
  -
    route-rules: ["route-rule-1", "route-rule-2"]  # 该上游数据库实例匹配的表到下游数据库的 table routing 规则名称
routes:                           # 上游和下游表之间的路由 table routing 规则集
  route-rule-1:                   # 配置名称
    schema-pattern: "test_*"      # 库名匹配规则,支持通配符 "*" 和 "?"
    table-pattern: "t_*"          # 表名匹配规则,支持通配符 "*" 和 "?"
    target-schema: "test"         # 目标库名称
    target-table: "t"             # 目标表名称

此为 dm task 完整的配置文件,可以根据需要进行配置~

烦请看下~

因为tidb中我有挺多的database的,怎么指定 -B tidb_test -T inv_fp_kj。

好的,谢谢。我再试一试。

你好,

:ok_hand:

可以先看下文档。

通过 black-white-list 匹配需要复制的数据库表。

谢谢,我先按照你的指导操作一下,再有问题还得请教你。十分感谢。

好的,开新帖继续提问哦~

谢谢,按照你发的task格式,问题解决了,数据可以同步了。谢谢你的指导,十分感谢。

:call_me_hand:,此为最基本的配置,有需要可以根据完整的配置文件自己学习配置哦~