TIDB Drainer无法启动,提示语法错误

我们的drainer启动时候报错,请问是否有大神帮忙看看呢

[FATAL] [main.go:50] [“create drainer server failed”] [error="initialize tidb type checkpoint with config &{CheckpointType:tidb Db:0xc0003be140 Schema:tidb-binlog Table:checkpoint ClusterID:6947119091400868786 InitialCommitTS:431610135554555933 CheckPointFile:/data/tidb-data/drainer-8249/savepoint}: exec failed, sql: create schema if not exists tidb-binlog: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 33 near “-binlog” "] [errorVerbose=“Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 33 near “-binlog” \ exec failed, sql: create schema if not exists tidb-binlog\ngithub.com/pingcap/tidb-binlog/drainer/checkpoint.newMysql\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb-binlog/drainer/checkpoint/mysql.go:73\ github.com/pingcap/tidb-binlog/drainer/checkpoint.NewCheckPoint\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb-binlog/drainer/checkpoint/checkpoint.go:54\ github.com/pingcap/tidb-binlog/drainer.NewServer\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb-binlog/drainer/server.go:142\ main.main\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb-binlog/cmd/drainer/main.go:48\ runtime.main\ \t/usr/local/go/src/runtime/proc.go:203\ runtime.goexit\ \t/usr/local/go/src/runtime/asm_amd64.s:1357\ initialize tidb type checkpoint with config &{CheckpointType:tidb Db:0xc0003be140 Schema:tidb-binlog Table:checkpoint ClusterID:6947119091400868786 InitialCommitTS:431610135554555933 CheckPointFile:/data/tidb-data/drainer-8249/savepoint}”] [stack=“main.main\ \t/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb-binlog/cmd/drainer/main.go:50\ runtime.main\ \t/usr/local/go/src/runtime/proc.go:203”]

1 个赞

是不是初始化的过程没正常跑完?

Schema:tidb-binlog Table:
checkpoint ClusterID:6947119091400868786 
InitialCommitTS:431610135554555933 
CheckPointFile:/data/tidb-data/drainer-8249/savepoint}:
 exec failed, sql: create schema if not exists tidb-binlog

参考下

核对下 tidb中 checkpoint 的配置信息,

最后核对一下 路径下是否存在数据? /data/tidb-data/drainer-8249/savepoint


Drainer配置文件schema改成tidb_binlog试试

[syncer.to.checkpoint]
# 当 checkpoint type 是 mysql 或 tidb 时可以开启该选项,以改变保存 checkpoint 的数据库
# schema = "tidb_binlog"
1 个赞

找到原因,很奇怪的一个问题,发现drainer的配置文件里的Schema:tidb_binlog 被改成了Schema:tidb-binlog ,(下划线给成了横杠)导致drainer无法启动,但是可以肯定的是我没有进行修改,只是通过tiup增加了tikv的节点,正在复盘操作过程,不知道是人为错误还是系统问题

估计有人动过了… 可能不是故意的
好好检查下环境

好的,非常感谢

我们经过三次测试了,都复现了这个现象,我们使用tiup cluster ** scale-out 增加节点(减少节点)的时候,会自动修改这个schema = “tidb_binlog” 为schema = “tidb-binlog” ,我们使用的4.0.9版本,这个应该是tidb的BUG

2 个赞

确实是bug,有小伙伴也遇到这个问题了,,恭喜你中奖拉~ :100:

drainer 目前不支持 checkpoint schema 名里有短横线,
https://github.com/pingcap/docs-cn/blob/master/config-templates/complex-tidb-binlog.yaml#L132
需要把 tiup 配置的这一项改为 tidb_binlog
后续会修改这里的文档

1 个赞

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。