【问题标题】:Debezium error, schema isn't know to this connectorDebezium 错误,此连接器不知道架构
【发布时间】: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_tableproject_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=falseinclude.schema.changes=false 参数是我用来使JSON 更简洁的参数,但它们的值不会改变offset.dat 文件中的任何内容。

【问题讨论】:

  • 我想知道这是否来自数据库的二进制日志配置。

标签: database jboss-tools debezium apache-pulsar


【解决方案1】:

问题出在database.history=io.debezium.relational.history.MemoryDatabaseHistory 行。历史将无法重新启动。您应该使用 FileDatabaseHistory 而不是它。

【讨论】:

  • 这些行database.history=io.debezium.relational.history.FileDatabaseHistory database.history.file.filename=history.dat 仍然存在同样的问题。奇怪的是,我没有创建任何“history.dat”。
  • 你注意到你在配置文件中有两次了吗?
  • 嗯,不,这很尴尬。这解决了我的问题,谢谢!
  • 嘿@JiriPechanec,我有一个类似的问题,除了我的数据库历史实际上是通过这个选项"database.history.kafka.topic" 存储在kafka 主题中的。而且我目前也遇到了这个“未知的模式”错误。我尝试删除+重新创建 Debezium mysql 连接器,但它仍然抛出此错误。在重新创建连接器之前是否需要删除并重新创建数据库历史主题?
猜你喜欢
  • 2020-02-27
  • 2019-02-05
  • 2022-06-02
  • 2020-01-05
  • 2019-07-30
  • 2019-07-22
  • 2019-05-08
  • 2019-11-21
  • 2021-09-08
相关资源
最近更新 更多