Confluent
1 前言
一个问题,一篇文章,一出故事。
笔者从新初始化Kafka集群后出现Kafka connect服务器无法启动的情况,于是手动启动服务发现如下报错。
2 最佳实践
2.1 手动启动服务排错
sudo -u cp-kafka-connect /usr/bin/connect-distributed /etc/kafka/connect-distributed.properties
错误信息如下,
[2022-06-27 10:13:19,582] ERROR [Worker clientId=connect-1, groupId=connect-cluster] Uncaught exception in herder work thread, exiting: (org.apache.kafka.connect.runtime.distributed.DistributedHerder:334) org.apache.kafka.common.config.ConfigException: Topic 'connect-offsets' supplied via the 'status.storage.topic' property is required to have 'cleanup.policy=compact' to guarantee consistency and durability of connector and task statuses, but found the topic currently has 'cleanup.policy=delete'. Continuing would likely result in eventually losing connector and task statuses and problems restarting this Connect cluster in the future. Change the 'status.storage.topic' property in the Connect worker configurations to use a topic with 'cleanup.policy=compact'. [2022-06-27 10:14:19,583] ERROR [Worker clientId=connect-1, groupId=connect-cluster] Uncaught exception in herder work thread, exiting: (org.apache.kafka.connect.runtime.distributed.DistributedHerder:334) org.apache.kafka.common.config.ConfigException: Topic 'connect-status' supplied via the 'status.storage.topic' property is required to have 'cleanup.policy=compact' to guarantee consistency and durability of connector and task statuses, but found the topic currently has 'cleanup.policy=delete'. Continuing would likely result in eventually losing connector and task statuses and problems restarting this Connect cluster in the future. Change the 'status.storage.topic' property in the Connect worker configurations to use a topic with 'cleanup.policy=compact'. [2022-06-27 10:16:28,480] ERROR [Worker clientId=connect-1, groupId=connect-cluster] Uncaught exception in herder work thread, exiting: (org.apache.kafka.connect.runtime.distributed.DistributedHerder:334) org.apache.kafka.common.config.ConfigException: Topic 'connect-configs' supplied via the 'config.storage.topic' property is required to have 'cleanup.policy=compact' to guarantee consistency and durability of connector configurations, but found the topic currently has 'cleanup.policy=delete'. Continuing would likely result in eventually losing connector configurations and problems restarting this Connect cluster in the future. Change the 'config.storage.topic' property in the Connect worker configurations to use a topic with 'cleanup.policy=compact'.
2.2 查询报错的Topis
kafka-topics --bootstrap-server cfkafka02:9092,cfkafka03:9092,cfkafka04:9092 --describe --topic connect-offsets kafka-topics --bootstrap-server cfkafka02:9092,cfkafka03:9092,cfkafka04:9092 --describe --topic connect-status kafka-topics --bootstrap-server cfkafka02:9092,cfkafka03:9092,cfkafka04:9092 --describe --topic connect-configs
2.3 删除报错的Topis
kafka-topics --bootstrap-server cfkafka02:9092,cfkafka03:9092,cfkafka04:9092 --delete --topic connect-offsets kafka-topics --bootstrap-server cfkafka02:9092,cfkafka03:9092,cfkafka04:9092 --delete --topic connect-status kafka-topics --bootstrap-server cfkafka02:9092,cfkafka03:9092,cfkafka04:9092 --delete --topic connect-configs
注:至此,故障解决!
参阅文档
===================
https://github.com/confluentinc/kafka-connect-jdbc/issues/189
没有评论