Debezium错误,此连接器不知道架构

时间:2019-07-22 13:54:31

标签: database jboss-tools debezium apache-pulsar

我有一个使用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

您可能了解到,我想做的是监视数据库中的hystory_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

我首先怀疑我用来简化json的schemas.enable=falseinclude.schema.changes=false参数,但它们的值对offset.dat文件没有任何改变。

1 个答案:

答案 0 :(得分:1)

恕我直言,问题出在console.log(this.vulYearCount); // Here, all the values are printed correctly 行。历史记录将无法在重启后继续存在-您应该使用FileDatabaseHistory代替它。