我的debezium mysql源连接器在Kafka上工作。我使用相同的数据库但具有不同的数据格式添加了另一个 debezium mysql 源连接器。结果,我的第一个连接器开始显示以下错误:
[2019-07-11 10:29:09,125] ERROR WorkerSourceTask{id=debezium-connector-0} Task threw an uncaught and unrecoverable exception
(org.apache.kafka.connect.runtime.WorkerTask:177)
org.apache.kafka.connect.errors.ConnectException: Encountered change event for table db.user whose schema isn't known to this connector
at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)
at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:208)
at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:508)
at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1095)
at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:943)
at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:580)
at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:825)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.kafka.connect.errors.ConnectException: Encountered change event for table db.user whose schema isn't known to this connector
at io.debezium.connector.mysql.BinlogReader.informAboutUnknownTableIfRequired(BinlogReader.java:758)
at io.debezium.connector.mysql.BinlogReader.handleUpdateTableMetadata(BinlogReader.java:733)
at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:492)
... 5 more
[2019-07-11 10:29:09,125] ERROR WorkerSourceTask{id=debezium-
connector-krazybee-0} Task is being killed and will not recover
until manually restarted
(org.apache.kafka.connect.runtime.WorkerTask:178)
[2019-07-11 10:29:09,125] INFO Stopping MySQL connector task
(io.debezium.connector.mysql.MySqlConnectorTask:430)
[2019-07-11 10:29:09,125] INFO ChainedReader: Stopping the binlog
reader (io.debezium.connector.mysql.ChainedReader:121)
[2019-07-11 10:29:09,126] INFO Discarding 0 unsent record(s) due
to the connector shutting down
(io.debezium.connector.mysql.BinlogReader:129)
[2019-07-11 10:29:09,126] INFO Discarding 0 unsent record(s) due to the connector shutting down (io.debezium.connector.mysql.BinlogReader:129)
我已经使用 REST API 重新启动了 debezium 连接器。
尽管我据我所知,debezium 连接器在数据库历史记录架构中不匹配,但无法弄清楚如何在不删除现有连接器的情况下更正它。
我还使用 PUT 请求重新加载了具有先前值的现有连接器,但没有用。
我相信
您对两个连接器使用相同的database.history.kafka.topic
。您应该为每个实例使用 unqiue 主题。