GalenGao
(Galen Gao)
1
各位好,今天我用dm1.0.4 同步数据到tidb,一直没有同步过去,后来才发现当我在MySQL数据库里新增数据时他的dmwork里就会报错,提示这个表不存在,然后我手动在tidb里建了这个表,他就会把新增的数据同步过去,我想问一下,一、我是否需要在tidb目标库新建库建表,会不会自动建;二、他不会先全量迁移过去吗?是我的task没有配置正确吗?task如下:
name: test
task-mode: all
is-sharding: false
remove-meta: false
enable-heartbeat: false
target-database:
host: “10.1.1.99”
port: 4000
user: “root”
password: “”
mysql-instances:
source-id: "mysql-replica-01"
route-rules: ["user-route-rules-schema"]
black-white-list: "instance"
routes:
user-route-rules-schema:
schema-pattern: “evbase”
target-schema: “gao”
black-white-list:
instance:
do-dbs: [“evbase”]
1、在使用 DM 进行同步的时候,有 3 种同步模式:all,full, incremental。上面这种情况,使用 all 模式,即会对表做全量同步包括建表,建索引,也会进行增量同步~
2、参考链接如下:
https://pingcap.com/docs-cn/tidb-data-migration/stable/task-configuration-file/
GalenGao
(Galen Gao)
3
可是我目前这个配置并不会全量同步?不知道为什么?当我在dmwork里看到如下错,然后我去tidb里创建表就可以,能同步增量数据,之前的就不能,其他表没新增的提示都不提示错误。
(*Syncer).Resume\
\t/home/jenkins/agent/workspace/build_dm_master/go/src/github.com/pingcap/dm/syncer/syncer.go:2320\
runtime.goexit\
\t/usr/local/go/src/runtime/asm_amd64.s:1357",“error”:{“ErrCode”:10005,“ErrClass”:1,“ErrScope”:2,“ErrLevel”:3,“Message”:“current pos (mysql-bin|000001.000912, 538626998): query statement failed: SHOW COLUMNS FROM gao
. syonline
: Error 1146: Table ‘gao.syonline’ doesn’t exist”,“RawCause”:“Error 1146: Table ‘gao.syonline’ doesn’t exist”}}"]
GalenGao
(Galen Gao)
5
---
name: test
task-mode: all
is-sharding: false
remove-meta: false
enable-heartbeat: false
target-database:
host: “10.1.1.99”
port: 4000
user: “root”
password: “”
mysql-instances:
source-id: "mysql-replica-01"
route-rules: ["user-route-rules-schema"]
black-white-list: "instance"
routes:
user-route-rules-schema:
schema-pattern: “evbase”
target-schema: “gao”
black-white-list:
instance:
do-dbs: [“evbase”]
GalenGao
(Galen Gao)
7
dm-work.log日志也是一直正常,除非有新增数据,然后那个表没有创建就会报错,说表不存在
GalenGao
(Galen Gao)
8
日志里有mysqldumper导出所有表的信息,就是tidb里没有相关库和表
请检查下 dm-worker 的日志,是否有 loader 相关的信息,以及 loader 阶段是否报错了
GalenGao
(Galen Gao)
10
我用的是docker -compose拉取的环境,是看哪里的日志
yilong
(yi888long)
13
您好:
1. 请问您是单机测试吗? 这里的报错,感觉是连接上游时无法连接,您的资源,比如内存,IO等如果有问题,可能导致session连接超时等报错。
2. 对于提示表不存在,请先检查你dump出的.sql文件,是否有此表的schema sql文件,多谢