[英]Debezium MySql Connector : Table snapshots are taken in a single thread?
[英]Updating a Debezium MySQL connector with table whitelist option
我正在使用 Debezium (0.7.5) MySQL 连接器,如果我想使用选项
table.whitelist<\/code>更新此配置,我试图了解什么是最佳方法。
假设我创建了一个连接器,如下所示:
curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://debezium-host/connectors/ -d '
{
"name": "MyConnector",
"config": {
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"connect.timeout.ms": "60000",
"tasks.max": "1",
"database.hostname": "myhost",
"database.port": "3306",
"database.user": "***",
"database.password": "***",
"database.server.id": "3227197",
"database.server.name": "MyServer",
"database.whitelist": "myDb",
"table.whitelist": "myDb.table1,myDb.table2",
"database.history.kafka.bootstrap.servers": "kb0:9092,kb1:9092,kb2:9092",
"database.history.kafka.topic": "MyConnectorHistoryTopic",
"max.batch.size": "1024",
"snapshot.mode": "initial",
"decimal.handling.mode": "double"
}
}'
Debezium Server 最新版本,可以添加如下配置
debezium.snapshot.new.tables=parallel
如果您使用的是 Debezium,您可以试试这个配置值
snapshot.new.tables=parallel
注意:Debeziyum Server 是一种支持 Kinesis、Google Pub sub 和 Apache Pulsar 的服务器。 我正在使用它,它的配置有点不同。 我必须在每个项目之前加上“debezium”
添加此配置后,任何添加到tables.whitelist 中,Debezium 都会为这些额外的表创建快照。
我无法将您指向文档,但我在 GitHub 中浏览了他们的代码,并且我实际上尝试了它,这对我有用。 这是 MySqlConnector 代码的链接
那里搜索 Field.create("snapshot.new.tables")
就我个人而言,我觉得 Debezium 有很多东西,但文档很分散。
我有同样的问题,并用 debezium 的信号表解决。 它以这种方式工作,您必须创建一个表以发送到数据表中的 debezium 命令。
CREATE TABLE public.debezium_signal (id VARCHAR(42) PRIMARY KEY, type VARCHAR(32) NULL, data VARCHAR(2048) NULL);
并在你的配置中设置做 debzium 一个标签"signal.data.collection": "public.debezium_signal"
之后,您可以在该表中使用 insert 发送命令:
INSERT INTO debezium_signal (id, type, data)
VALUES(gen_random_uuid(),'execute-snapshot','{"data-collections": "myDb.table3"]}');
在我的情况下,我必须在 table.include.list 和 column.include.list 中的列中添加 de table 信号。
https://debezium.io/documentation/reference/stable/configuration/signalling.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.