Dm数据同步

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:3.0.6
  • 【问题描述】:使用 DM-Ansible 部署 DM 集群; 按文档是操作的执行到这一步的时候提示这些

看起来是配置文件不正,请提供一下配置文件及更多日志信息

task.yaml 的格式看起来有点不对,请先校验一下,在线网址

好的,非常感谢

改过吗?现在应该正常了,现在执行结果还报错吗

执行结果还是报错

image 现在OK 了。谢谢

:+1:

谢谢!

:+1:

image 这是哪里的问题。是我哪里配置错了吗。上下游数据需要分配权限吗?

query-status + task 任务名,看下详细的报错内容或者看下 dm-worker 的日志也可以。有提供详细报错。

1.query-status + 任务名,上述截图中你这边后面跟的是配置文件,用法是错误的。请参考官方文档操作

2.报错显示该 deliveryapp 任务已存在,猜测是上面重复进行 start-task 导致。启动 task 任务后,如果 task 没有 stop,注意不要重复执行 start-task 的操作。启动后,如果有报错,需要根据报错情况对应解决问题。

麻烦帮忙看一下。谢谢

将任务停止,重新启动测试一下。

stop-task deliveryapp 后在重新启动任务start-task /home/tidb/dm-ansible-v1.0.2/conf/task.yaml

日志在提供多一些,是同步上游 test_db 下的 test_table 表吗 ?检查下 用户是否有相关权限。

是同步上游mariadb 的数据库到下游的TIDB数据库里,用户是否有相关权限 这个是在哪里设置。是要到上下游的数据库里么。 [2019/12/04 13:16:27.671 +08:00] [INFO] [server.go:410] [request=QueryWorkerConfig] [payload=] [2019/12/04 13:16:27.701 +08:00] [INFO] [server.go:150] [request=StartSubTask] [payload=“task:“is-sharding = false\nonline-ddl-scheme = \”\”\ncase-sensitive = false\nname = \“deliveryapp\”\nmode = \“all\”\nsource-id = \“mysql-replica-01\”\nserver-id = 0\nflavor = \"\"\nmeta-schema = \“dm_meta\”\nremove-meta = false\ndisable-heartbeat = true\nheartbeat-update-interval = 1\nheartbeat-report-interval = 10\nenable-heartbeat = false\ntimezone = \"\"\nbinlog-type = \“local\”\nrelay-dir = \"\"\nroute-rules = []\nfilter-rules = []\nmapping-rule = []\nmydumper-path = \"./bin/mydumper\"\nthreads = 4\nchunk-filesize = 64\nskip-tz-utc = true\nextra-args = \"-B test_db -T test_table\"\npool-size = 16\ndir = \"./dumped_data.deliveryapp\"\nmeta-file = \"\"\nworker-count = 16\nbatch = 100\nmax-retry = 0\nauto-fix-gtid = false\nenable-gtid = false\ndisable-detect = false\nsafe-mode = false\nenable-ansi-quotes = false\nlog-level = \"\"\nlog-file = \"\"\nlog-rotate = \"\"\npprof-addr = \"\"\nstatus-addr = \"\"\n\n[from]\n host = \“192.168.90.226\”\n port = 3306\n user = \“root\”\n password = \“01eQHeFcyGPI5o6ympX6TkDvL0p0yw5IgROq\”\n max-allowed-packet = 67108864\n\n[to]\n host = \“192.168.90.229\”\n port = 4000\n user = \“root\”\n password = \“zypOdn+blMoJ5fu2V9yp9UDuv2/sfKPVSzZy2a9yRQH4GVgxIcE=\”\n max-allowed-packet = 67108864\n\n[black-white-list]\n\n [[black-white-list.do-tables]]\n db-name = \“deliveryapp\”\n tbl-name = \“delivery_dtl\”\n" “] [2019/12/04 13:16:27.705 +08:00] [INFO] [worker.go:313] [“operate subtask”] [component=“worker controller”] [operation=Start] [task=deliveryapp] [2019/12/04 13:16:27.705 +08:00] [INFO] [server.go:227] [request=QueryTaskOperation] [payload=“name:“deliveryapp” logID:62 “] [2019/12/04 13:16:28.677 +08:00] [INFO] [worker.go:792] [“start to execute operation”] [component=“worker controller”] [oplog=”{“id”:62,“task”:{“op”:4,“name”:“deliveryapp”,“task”:“aXMtc2hhcmRpbmcgPSBmYWxzZQpvbmxpbmUtZGRsLXNjaGVtZSA9ICIiCmNhc2Utc2Vuc2l0aXZlID0gZmFsc2UKbmFtZSA9ICJkZWxpdmVyeWFwcCIKbW9kZSA9ICJhbGwiCnNvdXJjZS1pZCA9ICJteXNxbC1yZXBsaWNhLTAxIgpzZXJ2ZXItaWQgPSAxMDEKZmxhdm9yID0gIm15c3FsIgptZXRhLXNjaGVtYSA9ICJkbV9tZXRhIgpyZW1vdmUtbWV0YSA9IGZhbHNlCmRpc2FibGUtaGVhcnRiZWF0ID0gdHJ1ZQpoZWFydGJlYXQtdXBkYXRlLWludGVydmFsID0gMQpoZWFydGJlYXQtcmVwb3J0LWludGVydmFsID0gMTAKZW5hYmxlLWhlYXJ0YmVhdCA9IGZhbHNlCnRpbWV6b25lID0gIiIKYmlubG9nLXR5cGUgPSAibG9jYWwiCnJlbGF5LWRpciA9ICIvaG9tZS90aWRiL2RlcGxveS9yZWxheV9sb2ciCnJvdXRlLXJ1bGVzID0gW10KZmlsdGVyLXJ1bGVzID0gW10KbWFwcGluZy1ydWxlID0gW10KbXlkdW1wZXItcGF0aCA9ICIuL2Jpbi9teWR1bXBlciIKdGhyZWFkcyA9IDQKY2h1bmstZmlsZXNpemUgPSA2NApza2lwLXR6LXV0YyA9IHRydWUKZXh0cmEtYXJncyA9ICItQiB0ZXN0X2RiIC1UIHRlc3RfdGFibGUiCnBvb2wtc2l6ZSA9IDE2CmRpciA9ICIuL2R1bXBlZF9kYXRhLmRlbGl2ZXJ5YXBwIgptZXRhLWZpbGUgPSAiIgp3b3JrZXItY291bnQgPSAxNgpiYXRjaCA9IDEwMAptYXgtcmV0cnkgPSAwCmF1dG8tZml4LWd0aWQgPSBmYWxzZQplbmFibGUtZ3RpZCA9IGZhbHNlCmRpc2FibGUtZGV0ZWN0ID0gZmFsc2UKc2FmZS1tb2RlID0gZmFsc2UKZW5hYmxlLWFuc2ktcXVvdGVzID0gZmFsc2UKbG9nLWxldmVsID0gImluZm8iCmxvZy1maWxlID0gIi9ob21lL3RpZGIvZGVwbG95L2xvZy9kbS13b3JrZXIubG9nIgpsb2ctcm90YXRlID0gIiIKcHByb2YtYWRkciA9ICIiCnN0YXR1cy1hZGRyID0gIiIKCltmcm9tXQogIGhvc3QgPSAiMTkyLjE2OC45MC4yMjYiCiAgcG9ydCA9IDMzMDYKICB1c2VyID0gInJvb3QiCiAgcGFzc3dvcmQgPSAiMDFlUUhlRmN5R1BJNW82eW1wWDZUa0R2TDBwMHl3NUlnUk9xIgogIG1heC1hbGxvd2VkLXBhY2tldCA9IDY3MTA4ODY0CgpbdG9dCiAgaG9zdCA9ICIxOTIuMTY4LjkwLjIyOSIKICBwb3J0ID0gNDAwMAogIHVzZXIgPSAicm9vdCIKICBwYXNzd29yZCA9ICJ6eXBPZG4rYmxNb0o1ZnUyVjl5cDlVRHV2Mi9zZktQVlN6WnkyYTl5UlFINEdWZ3hJY0U9IgogIG1heC1hbGxvd2VkLXBhY2tldCA9IDY3MTA4ODY0CgpbYmxhY2std2hpdGUtbGlzdF0KCiAgW1tibGFjay13aGl0ZS1saXN0LmRvLXRhYmxlc11dCiAgICBkYi1uYW1lID0gImRlbGl2ZXJ5YXBwIgogICAgdGJsLW5hbWUgPSAiZGVsaXZlcnlfZHRsIgo=”},“ts”:1575436587704760423}”] [2019/12/04 13:16:28.681 +08:00] [INFO] [worker.go:829] [“started sub task”] [component=“worker controller”] [config=”{“is-sharding”:false,“online-ddl-scheme”:"",“case-sensitive”:false,“name”:“deliveryapp”,“mode”:“all”,“ignore-checking-items”:null,“source-id”:“mysql-replica-01”,“server-id”:101,“flavor”:“mysql”,“meta-schema”:“dm_meta”,“remove-meta”:false,“disable-heartbeat”:true,“heartbeat-update-interval”:1,“heartbeat-report-interval”:10,“enable-heartbeat”:false,“meta”:null,“Timezone”:"",“binlog-type”:“local”,“relay-dir”:"/home/tidb/deploy/relay_log",“from”:{“host”:“192.168.90.226”,“port”:3306,“user”:“root”,“max-allowed-packet”:67108864},“to”:{“host”:“192.168.90.229”,“port”:4000,“user”:“root”,“max-allowed-packet”:67108864},“route-rules”:[],“filter-rules”:[],“mapping-rule”:[],“black-white-list”:{“do-tables”:[{“db-name”:“deliveryapp”,“tbl-name”:“delivery_dtl”}],“do-dbs”:null,“ignore-tables”:null,“ignore-dbs”:null},“mydumper-path”:"./bin/mydumper",“threads”:4,“chunk-filesize”:64,“skip-tz-utc”:true,“extra-args”:"-B test_db -T test_table",“pool-size”:16,“dir”:"./dumped_data.deliveryapp",“meta-file”:"",“worker-count”:16,“batch”:100,“max-retry”:0,“auto-fix-gtid”:false,“enable-gtid”:false,“disable-detect”:false,“safe-mode”:false,“enable-ansi-quotes”:false,“log-level”:“info”,“log-file”:"/home/tidb/deploy/log/dm-worker.log",“log-rotate”:"",“pprof-addr”:"",“status-addr”:"",“config-file”:""}"] [2019/12/04 13:16:28.682 +08:00] [WARN] [syncer.go:2474] [“use system default time location”] [task=deliveryapp] [unit=“binlog replication”] [2019/12/04 13:16:28.682 +08:00] [INFO] [syncer.go:2476] [“use timezone”] [task=deliveryapp] [unit=“binlog replication”] [location=Local] [2019/12/04 13:16:28.682 +08:00] [INFO] [mydumper.go:276] [“create mydumper”] [task=deliveryapp] [unit=dump] [argument="[–host,192.168.90.226,–port,3306,–user,root,–outputdir,./dumped_data.deliveryapp,–logfile,/dev/stderr,–verbose,3,–threads,4,–chunk-filesize,64,–skip-tz-utc,-B,test_db,-T,test_table]"] [2019/12/04 13:16:28.707 +08:00] [INFO] [server.go:227] [request=QueryTaskOperation] [payload=“name:“deliveryapp” logID:62 “] [2019/12/04 13:16:28.770 +08:00] [INFO] [checkpoint.go:472] [“create checkpoint schema”] [task=deliveryapp] [unit=“binlog replication”] [component=“remote checkpoint”] [statement=“CREATE SCHEMA IF NOT EXISTS dm_meta“] [2019/12/04 13:16:28.772 +08:00] [INFO] [checkpoint.go:491] [“create checkpoint table”] [task=deliveryapp] [unit=“binlog replication”] [component=“remote checkpoint”] [statement=“CREATE TABLE IF NOT EXISTS dm_meta.deliveryapp_syncer_checkpoint (\n\t\t\tid VARCHAR(32) NOT NULL,\n\t\t\tcp_schema VARCHAR(128) NOT NULL,\n\t\t\tcp_table VARCHAR(128) NOT NULL,\n\t\t\tbinlog_name VARCHAR(128),\n\t\t\tbinlog_pos INT UNSIGNED,\n\t\t\tis_global BOOLEAN,\n\t\t\tcreate_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\tupdate_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n\t\t\tUNIQUE KEY uk_id_schema_table (id, cp_schema, cp_table)\n\t\t)”] [2019/12/04 13:16:28.776 +08:00] [INFO] [relay.go:89] [“current earliest active relay log”] [task=deliveryapp] [unit=“binlog replication”] [“active relay log”=.000001/master-bin.000014] [2019/12/04 13:16:28.779 +08:00] [INFO] [subtask.go:191] [“start to run”] [subtask=deliveryapp] [unit=Dump] [2019/12/04 13:16:28.779 +08:00] [INFO] [worker.go:883] [“end to execute operation”] [component=“worker controller”] [“oplog ID”=62] [] [2019/12/04 13:16:28.863 +08:00] [INFO] [mydumper.go:158] [“Server version reported as: 5.5.5-10.3.10-MariaDB-log”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.863 +08:00] [INFO] [mydumper.go:158] [“Selecting database: test_db”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.863 +08:00] [INFO] [mydumper.go:158] [“Connected to a MySQL server”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.865 +08:00] [INFO] [mydumper.go:158] [“Started dump at: 2019-12-04 13:16:28”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.866 +08:00] [INFO] [mydumper.go:158] [“Written master status”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.866 +08:00] [INFO] [mydumper.go:158] [“Multisource slave detected.”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.867 +08:00] [INFO] [mydumper.go:158] [“Thread 1 connected using MySQL connection ID 144145”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.869 +08:00] [INFO] [mydumper.go:158] [“Thread 2 connected using MySQL connection ID 144146”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.871 +08:00] [INFO] [mydumper.go:158] [“Thread 3 connected using MySQL connection ID 144147”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.872 +08:00] [INFO] [mydumper.go:158] [“Thread 4 connected using MySQL connection ID 144148”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.874 +08:00] [ERROR] [mydumper.go:164] [“Error: DB: test_db - Could not execute query: No database selected”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.874 +08:00] [ERROR] [mydumper.go:164] [“Error dumping create database (test_db): Unknown database ‘test_db’”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.874 +08:00] [INFO] [mydumper.go:158] [“Non-InnoDB dump complete, unlocking tables”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.874 +08:00] [INFO] [mydumper.go:158] [“Thread 3 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.874 +08:00] [INFO] [mydumper.go:158] [“Thread 1 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.874 +08:00] [INFO] [mydumper.go:158] [“Thread 4 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.874 +08:00] [INFO] [mydumper.go:158] [“Thread 2 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.874 +08:00] [INFO] [mydumper.go:158] [“Finished dump at: 2019-12-04 13:16:28”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:28.875 +08:00] [INFO] [mydumper.go:114] [“dump data finished”] [task=deliveryapp] [unit=dump] [“cost time”=95.053563ms] [2019/12/04 13:16:28.875 +08:00] [INFO] [subtask.go:233] [“unit process returned”] [subtask=deliveryapp] [unit=Dump] [stage=Paused] [status={}] [2019/12/04 13:16:28.875 +08:00] [ERROR] [subtask.go:252] [“unit process error”] [subtask=deliveryapp] [unit=Dump] [“error information”=”{“msg”:”[code=32001:class=dump-unit:scope=internal:level=high] mydumper runs with error: exit status 1. \n\n”}”] [2019/12/04 13:16:29.677 +08:00] [WARN] [task_checker.go:354] [“backoff skip auto resume task”] [component=“task checker”] [task=deliveryapp] [latestResumeTime=2019/12/04 13:16:29.677 +08:00] [duration=1s] [2019/12/04 13:16:29.709 +08:00] [INFO] [server.go:227] [request=QueryTaskOperation] [payload=“name:“deliveryapp” logID:62 “] [2019/12/04 13:16:32.556 +08:00] [INFO] [server.go:250] [request=QueryStatus] [payload=“name:“deliveryapp” “] [2019/12/04 13:16:34.677 +08:00] [INFO] [worker.go:313] [“operate subtask”] [component=“worker controller”] [operation=AutoResume] [task=deliveryapp] [2019/12/04 13:16:34.677 +08:00] [INFO] [task_checker.go:365] [“dispatch auto resume task”] [component=“task checker”] [task=deliveryapp] [opLogID=63] [2019/12/04 13:16:34.677 +08:00] [INFO] [purger.go:243] [“checking whether needing to purge relay log files”] [component=“relay purger”] [2019/12/04 13:16:35.677 +08:00] [INFO] [worker.go:792] [“start to execute operation”] [component=“worker controller”] [oplog=”{“id”:63,“task”:{“op”:6,“name”:“deliveryapp”},“ts”:1575436594677387292}”] [2019/12/04 13:16:35.677 +08:00] [INFO] [worker.go:879] [“auto_resume sub task”] [component=“worker controller”] [task=deliveryapp] [2019/12/04 13:16:35.677 +08:00] [INFO] [subtask.go:430] [“resume with unit”] [subtask=deliveryapp] [unit=Dump] [2019/12/04 13:16:35.677 +08:00] [INFO] [worker.go:883] [“end to execute operation”] [component=“worker controller”] [“oplog ID”=63] [] [2019/12/04 13:16:35.839 +08:00] [INFO] [mydumper.go:158] [“Server version reported as: 5.5.5-10.3.10-MariaDB-log”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.839 +08:00] [INFO] [mydumper.go:158] [“Selecting database: test_db”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.840 +08:00] [INFO] [mydumper.go:158] [“Connected to a MySQL server”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.841 +08:00] [INFO] [mydumper.go:158] [“Started dump at: 2019-12-04 13:16:35”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.842 +08:00] [INFO] [mydumper.go:158] [“Written master status”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.842 +08:00] [INFO] [mydumper.go:158] [“Multisource slave detected.”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.843 +08:00] [INFO] [mydumper.go:158] [“Thread 1 connected using MySQL connection ID 144152”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.849 +08:00] [INFO] [mydumper.go:158] [“Thread 2 connected using MySQL connection ID 144153”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.851 +08:00] [INFO] [mydumper.go:158] [“Thread 3 connected using MySQL connection ID 144154”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.852 +08:00] [INFO] [mydumper.go:158] [“Thread 4 connected using MySQL connection ID 144155”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.854 +08:00] [ERROR] [mydumper.go:164] [“Error: DB: test_db - Could not execute query: No database selected”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.854 +08:00] [ERROR] [mydumper.go:164] [“Error dumping create database (test_db): Unknown database ‘test_db’”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.854 +08:00] [INFO] [mydumper.go:158] [“Non-InnoDB dump complete, unlocking tables”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.854 +08:00] [INFO] [mydumper.go:158] [“Thread 1 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.854 +08:00] [INFO] [mydumper.go:158] [“Thread 2 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.855 +08:00] [INFO] [mydumper.go:158] [“Thread 3 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.855 +08:00] [INFO] [mydumper.go:158] [“Thread 4 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.855 +08:00] [INFO] [mydumper.go:158] [“Finished dump at: 2019-12-04 13:16:35”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:35.855 +08:00] [INFO] [mydumper.go:114] [“dump data finished”] [task=deliveryapp] [unit=dump] [“cost time”=171.760925ms] [2019/12/04 13:16:35.855 +08:00] [INFO] [subtask.go:233] [“unit process returned”] [subtask=deliveryapp] [unit=Dump] [stage=Paused] [status={}] [2019/12/04 13:16:35.855 +08:00] [ERROR] [subtask.go:252] [“unit process error”] [subtask=deliveryapp] [unit=Dump] [“error information”=”{“msg”:”[code=32001:class=dump-unit:scope=internal:level=high] mydumper runs with error: exit status 1. \n\n"}"] [2019/12/04 13:16:39.678 +08:00] [INFO] [worker.go:313] [“operate subtask”] [component=“worker controller”] [operation=AutoResume] [task=deliveryapp] [2019/12/04 13:16:39.678 +08:00] [INFO] [worker.go:792] [“start to execute operation”] [component=“worker controller”] [oplog="{“id”:64,“task”:{“op”:6,“name”:“deliveryapp”},“ts”:1575436599677730226}"] [2019/12/04 13:16:39.678 +08:00] [INFO] [task_checker.go:365] [“dispatch auto resume task”] [component=“task checker”] [task=deliveryapp] [opLogID=64] [2019/12/04 13:16:39.678 +08:00] [INFO] [worker.go:879] [“auto_resume sub task”] [component=“worker controller”] [task=deliveryapp] [2019/12/04 13:16:39.678 +08:00] [INFO] [subtask.go:430] [“resume with unit”] [subtask=deliveryapp] [unit=Dump] [2019/12/04 13:16:39.678 +08:00] [INFO] [worker.go:883] [“end to execute operation”] [component=“worker controller”] [“oplog ID”=64] [] [2019/12/04 13:16:39.691 +08:00] [INFO] [mydumper.go:158] [“Server version reported as: 5.5.5-10.3.10-MariaDB-log”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.691 +08:00] [INFO] [mydumper.go:158] [“Selecting database: test_db”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.691 +08:00] [INFO] [mydumper.go:158] [“Connected to a MySQL server”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.694 +08:00] [INFO] [mydumper.go:158] [“Started dump at: 2019-12-04 13:16:39”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.694 +08:00] [INFO] [mydumper.go:158] [“Written master status”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.695 +08:00] [INFO] [mydumper.go:158] [“Multisource slave detected.”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.697 +08:00] [INFO] [mydumper.go:158] [“Thread 1 connected using MySQL connection ID 144157”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.700 +08:00] [INFO] [mydumper.go:158] [“Thread 2 connected using MySQL connection ID 144158”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.707 +08:00] [INFO] [mydumper.go:158] [“Thread 3 connected using MySQL connection ID 144159”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.710 +08:00] [INFO] [mydumper.go:158] [“Thread 4 connected using MySQL connection ID 144160”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.711 +08:00] [ERROR] [mydumper.go:164] [“Error: DB: test_db - Could not execute query: No database selected”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.711 +08:00] [ERROR] [mydumper.go:164] [“Error dumping create database (test_db): Unknown database ‘test_db’”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.711 +08:00] [INFO] [mydumper.go:158] [“Non-InnoDB dump complete, unlocking tables”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.712 +08:00] [INFO] [mydumper.go:158] [“Thread 2 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.712 +08:00] [INFO] [mydumper.go:158] [“Thread 1 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.712 +08:00] [INFO] [mydumper.go:158] [“Thread 3 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.712 +08:00] [INFO] [mydumper.go:158] [“Thread 4 shutting down”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.713 +08:00] [INFO] [mydumper.go:158] [“Finished dump at: 2019-12-04 13:16:39”] [task=deliveryapp] [unit=dump] [2019/12/04 13:16:39.713 +08:00] [INFO] [mydumper.go:114] [“dump data finished”] [task=deliveryapp] [unit=dump] [“cost time”=34.255932ms] [2019/12/04 13:16:39.713 +08:00] [INFO] [subtask.go:233] [“unit process returned”] [subtask=deliveryapp] [unit=Dump] [stage=Paused] [status={}] [2019/12/04 13:16:39.713 +08:00] [ERROR] [subtask.go:252] [“unit process error”] [subtask=deliveryapp] [unit=Dump] [“error information”="{“msg”:"[code=32001:class=dump-unit:scope=internal:level=high] mydumper runs with error: exit status 1. \n\n"}"]

检查下 上游数据库是否存在 test_db 库,上面的报错就是 dump 失败的原因。

另外补充下,mydumper 的参数是上面 task 配置中 extra-args 中配置有 test_db 库,可以对应修改下,指定需要 dump 的数据库以及表。

在 dm-worker 中配置的上游数据库的账号密码,需要确保有对应的权限。