tidbbinlog集群迁移无法正常同步

【 TiDB 使用环境】Poc

【 TiDB 版本】源v5.1.2 目标集群:v8.1.0

【复现路径】

源tidb v5.1.2:

pd:192.168.132.41

pd:192.168.132.42

pd:192.168.132.43

tidb:192.168.132.41

目标tidb v8.1.0:

tidb:192.168.132.61

pd:192.168.132.61

pd:192.168.132.62

pd:192.168.132.63

步骤:

  1. 源开启binlog

tiup cluster edit-config tidb-test

server_configs:

tidb:
binlog.enable: true
binlog.ignore-error: true
tiup cluster reload tidb-test -R tidb
show variables like "log_bin";
  1. pump启动

/home/tidb/toolkit/tidb-community-toolkit-v8.1.0-linux-amd64/pump -config pump.toml



# Pump Configuration

addr = "192.168.132.60:8250"

advertise-addr = "192.168.132.60:8250"

gc = 7

data-dir = "data.pump"

heartbeat-interval = 2

# PD 集群节点的地址 (英文逗号分割,中间不加空格)

pd-urls = "http://192.168.132.41:2379,http://192.168.132.42:2379,http://192.168.132.43:2379"

  1. 备份dumping

/home/tidb/toolkit/tidb-community-toolkit-v8.1.0-linux-amd64/dumpling -u root -P 4000 -p’_wUL+87’ -h 192.168.132.41 --filetype sql -t 8 -o ./dumpling_output -r 200000 -F256MiB

  1. lightning恢复

/home/tidb/toolkit/tidb-community-toolkit-v8.1.0-linux-amd64/tidb-lightning -c /home/tidb/lightning/tidb-lightning.toml

cat tidb-lightning.toml

[lightning]

level = "info"

file = "tidb-lightning.log"

status-addr = ":8289"

task-info-schema-name = 'lightning_task_info'

max-error = 100

[mydumper]

data-source-dir = "/home/tidb/dumpling/dumpling_output"

character-set = "auto"

filter = ['*.*', '!mysql.*', '!sys.*', '!INFORMATION_SCHEMA.*', '!PERFORMANCE_SCHEMA.*', '!METRICS_SCHEMA.*', '!INSPECTION_SCHEMA.*']

[conflict]

strategy = "replace"

[tikv-importer]

parallel-import = false

backend = "local"

sorted-kv-dir = '/tmp/lightning/'

[tidb]

host = '192.168.132.61'

port = 4000

user = 'root'

password = '40r76s^9AK@8cW*Sh_'
  1. 启动drainer

/home/tidb/toolkit/tidb-community-toolkit-v8.1.0-linux-amd64/drainer -config drainer.toml -initial-commit-ts 452198990463631362

配置:

# Drainer Configuration.

addr = "192.168.132.60:8249"

advertise-addr = "192.168.132.60:8249"

detect-interval = 10

data-dir = "data.drainer"

pd-urls = "http://192.168.132.41:2379,http://192.168.132.42:2379,http://192.168.132.43:2379"

# log 文件路径

log-file = "drainer.log"

compressor = "gzip"

# Syncer Configuration

[syncer]

txn-batch = 20

worker-count = 16

disable-dispatch = false

safe-mode = false

db-type = "tidb"

ignore-txn-commit-ts = []

ignore-schemas = "INFORMATION_SCHEMA,PERFORMANCE_SCHEMA,mysql"

[syncer.to]

host = "192.168.132.61"

user = "root"

password = "40r76h_"

port = 4000

验证

【遇到的问题:问题现象及影响】
源:

目标:
image

源端create table,目标没改表
【pump日志】

【draner日志】


哪有先开 binlog.enable,再扩容 pump 组件的,那这俩之前的 binlog 往那里写呢? 你现在再执行一遍 tiup cluster reload tidb-test -R tidb 做下测试

binlog 功能在最新版本里应该不推荐使用了吧?

这应该是做跨机升级迁移。5版本没有cdc

为啥不在v5集群的扩容v5版本的drainer,pump,远程写入v8集群呢