TiDB Binlog 部署拓扑

本文介绍在部署最小拓扑集群的基础上,同时部署 TiDB Binlog。TiDB Binlog 是目前广泛使用的增量同步组件,可提供准实时备份和同步功能。

拓扑信息

实例个数物理机配置IP配置
TiDB316 VCore 32 GB10.0.1.1
10.0.1.2
10.0.1.3
默认端口配置;
开启 enable_binlog;
开启 ignore-error
PD34 VCore 8 GB10.0.1.4
10.0.1.5
10.0.1.6
默认端口配置
TiKV316 VCore 32 GB10.0.1.7
10.0.1.8
10.0.1.9
默认端口配置
Pump38 VCore 16GB10.0.1.1
10.0.1.7
10.0.1.8
默认端口配置;
设置 GC 时间 7 天
Drainer18 VCore 16GB10.0.1.12默认端口配置;
设置默认初始化 commitTS -1 为最近的时间戳
配置下游目标 TiDB 10.0.1.12:4000

拓扑模版

简单 TiDB Binlog 配置模板(下游为 MySQL)

简单 TiDB Binlog 配置模板(下游为 file)

详细 TiDB Binlog 配置模板

以上 TiDB 集群拓扑文件中,详细的配置项说明见通过 TiUP 部署 TiDB 集群的拓扑文件配置

关键参数介绍

拓扑配置模版的关键参数如下:

  • server_configs.tidb.binlog.enable: true

    开启 TiDB Binlog 服务,默认为 false。

  • server_configs.tidb.binlog.ignore-error: true

    高可用场景建议开启,如果设置为 true,发生错误时,TiDB 会停止写入 TiDB Binlog,并且在监控项 tidb_server_critical_error_total 上计数加 1;如果设置为 false,一旦写入 TiDB Binlog 失败,会停止整个 TiDB 的服务。

  • drainer_servers.config.syncer.db-type

    TiDB Binlog 的下游类型,目前支持 mysqltidbkafkafile

  • drainer_servers.config.syncer.to

    TiDB Binlog 的下游配置。根据 db-type 的不同,该选项可配置下游数据库的连接参数、Kafka 的连接参数、文件保存路径。详细说明可参见 TiDB Binlog 配置说明

下载 PDF
产品
TiDB
TiDB Cloud
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.