【发布时间】:2019-11-30 12:31:26
【问题描述】:
我有一个使用 Debezium 的项目,主要基于 this example,然后连接到 Apache Pulsar。
我更改了一些配置。该文件现在看起来像这样:
database.history=io.debezium.relational.history.MemoryDatabaseHistory
connector.class=io.debezium.connector.mysql.MySqlConnector
offset.storage=org.apache.kafka.connect.storage.FileOffsetBackingStore
offset.storage.file.filename=offset.dat
offset.flush.interval.ms=5000
name=mysql-dbz-connector
database.hostname={ip}
database.port=3308
database.user={user}
database.password={pass}
database.dbname=database
database.server.name=test
table.whitelist=database.history_table,database.project_table
snapshot.mode=schema_only
schemas.enable=false
include.schema.changes=false
pulsar.topic=persistent://public/default/{0}
pulsar.broker.address=pulsar://{ip}:6650
database.history=io.debezium.relational.history.MemoryDatabaseHistory
正如您所理解的,我正在尝试做的是监控数据库中的history_table 和project_table 修改,然后将有效负载写入 Apache Pulsar。
我的问题如下。在我使用的任何快照模式下,当写入偏移量时,我无法重新启动 Debezium 而不会在下一次数据库更新时出现错误。
Encountered change event for table database.history_table whose schema isn't known to this connector
这只发生在现有的offset.dat 文件中。我认为这是因为 offset.dat 文件中的架构为空。以这个为例:
¨Ìsrjava.util.HashMap⁄¡√`—F
loadFactorI thresholdxp?@wur[B¨Û¯T‡xpG{"schema":null,"payload":["mysql-dbz-connector",{"server":"test"}]}uq~U{"ts_sec":1563802215,"file":"database-bin.000005","pos":79574,"server_id":1,"event":1}x
我首先怀疑schemas.enable=false 或include.schema.changes=false 参数是我用来使JSON 更简洁的参数,但它们的值不会改变offset.dat 文件中的任何内容。
【问题讨论】:
-
我想知道这是否来自数据库的二进制日志配置。
标签: database jboss-tools debezium apache-pulsar