安装步骤
slave_debezium
,并给予从库权限关键配置说明
- table.include.list 要监听的对象表(命名形式 库名.表名,库名.表名)
- snapshot.mode = schema_only (在任务启动时,只做表结构快照,不做数据快照,默认的 initial 策略会对监听的表做全量快照,遇到数据量大的表可能会影响生产写入)
- snapshot.locking.mode = none(快照时不使用锁,避免影响生产写操作)
- signal.data.collection = app_dev.debezium_signal(指定 dbz 的 信号表,用于触发增量快照)
- read.only = true (只读账号时必须指定,否则会尝试对 debezium_signal 表做 insert 操作来产生水位信息)
- transforms = reroute (SMT 相关配置,通过正则表达式调整 dbz 默认的 topic 策略)
- decimal.handling.mode = string (将 mysql 中 decimal 类型转换为 string 输出, 确保不丢失精度)
- converters = bitOneToInt (默认 bit 会转换为 boolean 类型,这里通过自定义 CustomConvert 修改默认行为)下面暂时没用到

debezium-connect 常用 rest 操作
问题处理记录

MySQL binlog 验证
结论 每条 update 操作都会有对应的binlog 日志
"gtid": "57561b7b-e2a7-11ef-9d3b-0242ac130003:1252076"
可以看出,同一个事务中两次针对同一条数据的 update 操作都会产生对应的 binlog📎 参考文章
DebeziumRead-only Incremental Snapshots for MySQL
Read-only Incremental Snapshots for MySQL
Debezium is an open source distributed platform for change data capture. Start it up, point it at your databases, and your apps can start responding to all of the inserts, updates, and deletes that other apps commit to your databases. Debezium is durable and fast, so your apps can respond quickly and never miss an event, even when things go wrong.
Debezium connector for MySQL :: Debezium Documentation
Debezium connector for MySQL :: Debezium Documentation
MySQL has a binary log (binlog) that records all operations in the order in which they are committed to the database. This includes changes to table schemas as well as changes to the data in tables. MySQL uses the binlog for replication and recovery.
Amazon Web ServicesDebezium 特性深入介绍 | Amazon Web Services
Debezium 特性深入介绍 | Amazon Web Services
在这篇文章中,我将介绍并演示 Debezium 的相关特性以及配置方式,让大家可以在生产环境中更放心地使用。
Debezium系列- snapshot锁表流程详解_debezium 流程图-CSDN博客
Debezium系列- snapshot锁表流程详解_debezium 流程图-CSDN博客
文章浏览阅读3.7k次。背景采用Debezium 同步MySQL表的时候,同一张表有时候有时会锁表,有时不会锁表。为了弄清楚原因梳理了snapshot的流程snapshot 流程图如何排查Debezium锁问题引起的主从延迟?谁持有的锁?继续查询information_schema.innodb_locks、innodb_lock_waits、innodb_trx表select * from information_schema.innodb_locks;select * from information_schem_debezium 流程图
Level Up CodingFixing Debezium Connectors when they break on production.
Fixing Debezium Connectors when they break on production.
Debezium is a wonderful piece of tech made possible by the hard work of many folks. You can easily start a Debezium connector having…
墨滴社区
墨滴社区