当我通过kakfa-connect的REST API检查我的debezium连接器的状态时,我看到连接器的错误消息:
org.apache.kafka.connect.errors.ConnectException:从机为使用CHANGE MASTER TO MASTER_AUTO_POSITION=1进行连接,但master已清除二进制日志,其中包含从属需要。错误代码:1236;SQLSTATE:HY000。\n\tatio.debezium.connecter.mysql.AbstractReader.wrap(AbstractReader.java:230(\n\tatio.debezium.connecter.mysql.AbstractReader.failed(AbstractReader.java:197(\n\tatio.debezium.connecter.mysql.BinlogReader$ReaderThreadLifecycleListener.onCommunicationFailure(BinlogReader.java:997(\n\tatcom.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:950(\n\tatcom.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:580(\n\tatcom.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:825(\n\tatjava.lang.Thread.run(Thread.java:748(\n使用者:com.github.shyiko.mysql.binlog.network.ServerException:从设备为使用CHANGE MASTER TO MASTER_AUTO_POSITION=1进行连接,但master已清除二进制日志,其中包含从属需要。\n\tatcom.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:914(\n\t。。。3个
这是我如何配置debezium连接器的问题还是MySQL的问题?疯狂的是,即使我尝试将选项snapshot.mode
设置为never
,这个错误仍然存在!根据文档,当snapshot.mode
设置为never
或when_needed
时,它不应该需要GTID,所以我对发生的事情非常困惑
问题是Debezium可能已经停机一段时间了,一些它没有看到的事务在服务器上不再可用。
这可能是连接器偏移量错误的问题。因此,我删除了连接器,删除了所有相关的Kafka主题(如模式历史等(,并使用以下指南清理了偏移https://debezium.io/documentation/faq/#how_to_remove_committed_offsets_for_a_connector它起到了作用!重新创建后,连接器现在可以正常工作。