产品概述
应用场景
产品架构
实例类型
兼容性说明
使用规范建议
## 部署 TiUPcurl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | shsource /root/.bash_profile## 部署 Dumpling 并升级到最新版本tiup install dumplingtiup update --self && tiup update dumpling
SET GLOBAL tidb_gc_enable = FALSE;
SELECT @@global.tidb_gc_enable;
+-------------------------+| @@global.tidb_gc_enable |+-------------------------+| 0 |+-------------------------+1 row in set (0.00 sec)
tiup dumpling -u root -P 4000 -h tidb_host -o /tmp/test
metadata:包含导出起始时间和主库 binlog 位置{schema}-schema-create.sql:创建 schema 的 SQL 文件{schema}.{table}-schema.sql:创建表的 SQL 文件{schema}.{table}.{0001}.{sql|csv}:数据文件*-schema-view.sql、*-schema-trigger.sql、*-schema-post.sql:其他导出的 SQL 文件Started dump at: 2025-12-02 12:42:53SHOW MASTER STATUS:Log: tidb-binlogPos: 462583122654920710GTID:Finished dump at: 2025-12-02 12:42:53
Pos 后数字为导出所使用的 TiDB 时间戳,该时间戳将用于后续增量迁移设置 TiCDC 回放起点。-d 所使用的目录为前例中 Dumpling 所导出的目录。myloader -h tdsql_host -P 3306 --user tdsqluser -d /tmp/test
start-ts设为从 Dumpling metadata 中获取的时间戳。详情可参考 TiDB 官方说明。tiup cdc cli changefeed create --server=http://ticdc_host:8300 --sink-uri='mysql://tdsql_user@tdsql_host:3306' --changefeed-id="upstream-to-downstream" --start-ts="462583122654920710"
SET GLOBAL tidb_gc_enable = TRUE;
SELECT @@global.tidb_gc_enable;
+-------------------------+| @@global.tidb_gc_enable |+-------------------------+| 1 |+-------------------------+1 row in set (0.00 sec)
文档反馈