Debezium Kafka Connect连接器未成功更新

时间:2019-05-29 08:03:35

标签: mysql apache-kafka apache-kafka-connect debezium

我正在尝试使用Debezium和Kafka进行CDC。我已经在table.whitelist属性中注册了具有3个表的连接器,并且该连接器工作正常。这是正在运行的连接器的配置。

{"name":"xoom-eds-extactor","config":{"connector.class":"io.debezium.connector.mysql.MySqlConnector","database.user":"debezium","database.server.id":"1","database.hostname":"qa514dtc001.ord.qa001.xoom.com","database.password":"xoom123","database.history.kafka.bootstrap.servers":"eds-kafka1:9092","database.history.kafka.topic":"dbhistory.inventory","name":"xoom-eds-extactor","database.server.name":"MySQL-Database-Docker","database.port":"3306","include.schema.changes":"true","table.whitelist":"xoom_eds_extraction_src_db_mock.postal_code_mock,xoom_eds_extraction_src_db_mock.account_number_mock,xoom_eds_extraction_src_db_mock.credit_card_number_mock,xoom_eds_extraction_src_db_mock.ip_address_details_mock,xoom_eds_extraction_src_db_mock.university_details_mock"},"tasks":[{"connector":"xoom-eds-extactor","task":0}],"type":"source"}

现在,我想更新连接器,并从同一数据库添加另外两个表。我正在使用以下命令和配置文件来更新连接器。

命令

curl -X PUT -H "Content-Type: application/json" --data @xoom-eds-extactor-conf.json "http://eds-kafka1:8083/connectors/xoom-eds-extactor/config"

配置json

{
   "name":"xoom-eds-extactor",
   "connector.class":"io.debezium.connector.mysql.MySqlConnector",
   "database.hostname":"qa514dtc001.ord.qa001.xoom.com",
   "database.port":"3306",
   "database.user":"debezium",
   "database.password":"xoom123",
   "database.server.id":"1",
   "database.server.name":"MySQL-Database-Docker",
   "database.history.kafka.bootstrap.servers":"eds-kafka1:9092",
   "database.history.kafka.topic":"dbhistory.inventory",
   "include.schema.changes":"true",
"table.whitelist":"xoom_eds_extraction_src_db_mock.postal_code_mock,xoom_eds_extraction_src_db_mock.account_number_mock,xoom_eds_extraction_src_db_mock.credit_card_number_mock,xoom_eds_extraction_src_db_mock.ip_address_details_mock,xoom_eds_extraction_src_db_mock.university_details_mock"
}

这成功执行,但是当我列出Kafka主题时,仅显示最后3个主题。未添加2个新主题。

MySQL-Database-Docker
MySQL-Database-Docker.xoom_eds_extraction_src_db_mock.account_number_mock
MySQL-Database-Docker.xoom_eds_extraction_src_db_mock.credit_card_number_mock
MySQL-Database-Docker.xoom_eds_extraction_src_db_mock.postal_code_mock
__consumer_offsets
connect-configs
connect-offsets
connect-status
dbhistory.inventory

外面有人可以帮助我吗?预先感谢。

1 个答案:

答案 0 :(得分:0)

据我所知,存在与此问题相关的旧的PR,应该在0.9.1版本中对其进行修复。但是,如果您使用的是旧版本,则只需执行以下步骤即可。

  • 添加新表,但尚未写入新表
  • 关闭连接器
  • 更改过滤器配置并将快照模式设置为“ schema_only_recovery
  • 删除(或重命名)现有的数据库历史记录主题
  • 重新启动连接器;这将重新创建数据库架构的内部历史记录,然后从先前记录的偏移量继续流式传输
  • 开始写入新表

至少这是我们的工作(我们仍在使用0.8.2)。

来源:debezium-google-group