背景:已使用tiup安装部署tidb4.0.6 的tidb/pd/tikv
问题1:现在需要部署pump/Drainer 同步tidb中单个库aa到下游mysql的bb库,已使用tiup增加组件pump,现在我想知道如何配置部署Drainer ,让tidb中的aa库同步到bb库?
问题2:binlogctl在官方文档中给出的地址下载binlogctl,压缩包中并无binlogctl
背景:已使用tiup安装部署tidb4.0.6 的tidb/pd/tikv
问题1:现在需要部署pump/Drainer 同步tidb中单个库aa到下游mysql的bb库,已使用tiup增加组件pump,现在我想知道如何配置部署Drainer ,让tidb中的aa库同步到bb库?
问题2:binlogctl在官方文档中给出的地址下载binlogctl,压缩包中并无binlogctl
tiup ctl binlog --help
tidb-binlog 由 pump 和 drainer 组成,
drainer 的扩容建议和 pump 一起进行,如果 tidb 产生的 binglog 较大,pump gc time 默认是 7 天,会产生大量的 log 占用磁盘空间。(数据量较小可以忽略)
drainer 的 scale 和 pump 一样,tiup scale drainer 可以看下
–编辑drainer配置文件
vi scale-out-drainer.yaml
drainer_servers:
–扩容部署drainer
tiup cluster scale-out tidb-test scale-out-drainer.yaml
以上是配置文件,但是我不知道,怎么配置tidb下的aa库,同步到下游mysql的bb库?
你好,
tidb-binlog 组件不支持此功能
那如果正常使用 我上面的配置没问题吧
可以的,默认过滤系统数据库,进行增量复制
drainer_servers:
- host: xxx
port: 8249
data_dir: "/data1/tidb-data/drainer-8249"
initial_commit_ts: xxxx
deploy_dir: "/data1/tidb-deploy/drainer-8249"
config:
syncer.db-type: "mysql"
syncer.to.host: "xxx"
syncer.to.user: "xxx"
syncer.to.password: "xxx"
syncer.to.port: 3306
syncer.replicate-do-db: ["xxx"]
[syncer.to.checkpoint]
type: "mysql"
schema: "xxx"
host: "xxx"
user: "xxx"
password: "xxx"
port: 3306
[syncer.relay]
log-dir = "/data1/relay_log"
[tidb@tidbpd data1]$ tiup cluster scale-out tidb-test scale-out-drainer.yaml
Starting component cluster: /home/tidb/.tiup/components/cluster/v1.1.2/tiup-cluster scale-out tidb-test scale-out-drainer.yaml
Error: Failed to parse topology file scale-out-drainer.yaml (topology.parse_failed)
caused by: yaml: line 16: could not find expected ':'
Please check the syntax of your topology file scale-out-drainer.yaml and try again.
Error: run /home/tidb/.tiup/components/cluster/v1.1.2/tiup-cluster (wd:/home/tidb/.tiup/data/SBqccxt) failed: exit status 1
其中 checkpoint部分写成以下格式,也报同样的错误
[syncer.to.checkpoint]
type = “mysql”
schema = “xxx”
host = “xxx”
user = “xxx”
password = “xxx”
port = 3306
你好,麻烦将 [syncer.to.checkpoint] 和 [syncer.relay] 都放到 config 下面再试下呢?
drainer_servers:
- host: xxx
port: 8249
data_dir: "/data1/tidb-data/drainer-8249"
initial_commit_ts: xxxx
deploy_dir: "/data1/tidb-deploy/drainer-8249"
config:
syncer.db-type: "mysql"
syncer.to.host: "xxx"
syncer.to.user: "xxx"
syncer.to.password: "xxx"
syncer.to.port: 3306
syncer.replicate-do-db: ["xxx"]
syncer.to.checkpoint.type: "mysql"
syncer.to.checkpoint.schema: "xxx"
syncer.to.checkpoint.host: "xxx"
syncer.to.checkpoint.user: "xxx"
syncer.to.checkpoint.password: "xxx"
syncer.to.checkpoint.port: 3306
syncer.relay.log-dir: "/data1/relay_log"
此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。