想知道如何从zookeeper看起来的独特情况中恢复过来 拥有主题(T_60036)元数据,但经纪人没有相应的 日志文件导致生成器失败并带有异常
kafka.common.FailedToSendMessageException
以下是我们注意到的事项:
在zookeeper中,存在/ broker / topics / T_60036和/ config / topics / T_60036路径。
kafka@kafka-3:~$ /opt/kafka/kafka_2.10-0.8.1.1/bin/zookeeper-shell.sh
localhost:2181 get /brokers/topics/T_60036/partitions/0/state
Connecting to localhost:2181
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
{"controller_epoch":6,"leader":1,"version":1,"leader_epoch":0,"isr":[1,2]}
cZxid = 0x80013308c
ctime = Wed Jun 06 04:55:37 UTC 2018
mZxid = 0x80013308c
mtime = Wed Jun 06 04:55:37 UTC 2018
pZxid = 0x80013308c
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 74
numChildren = 0
kafka@kafka-3:~$ /opt/kafka/kafka_2.10-0.8.1.1/bin/zookeeper-shell.sh
localhost:2181 get /config/topics/T_60036
Connecting to localhost:2181
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
{"version":1,"config":{}}
cZxid = 0x800132992
ctime = Wed Jun 06 04:55:13 UTC 2018
mZxid = 0x800132992
mtime = Wed Jun 06 04:55:13 UTC 2018
pZxid = 0x800132992
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 25
numChildren = 0
但是这个主题没有日志文件:
kafka@kafka-3:~$ ls -l /var/kafka/topics/T_60036*
ls: cannot access /var/kafka/topics/T_60036*: No such file or directory
我确实阅读了第二条评论主题删除here,但我担心它可能会破坏整个群集的稳定性。我的问题是删除orphan zookeeper条目是否安全(“/ config / topics / T_60036”, “/ brokers / topics / T_60036”)来自zookeeper而无需重启或 危害集群。
这是我们的配置
Version: kafka_2.10-0.8.1.1
Cluster Configuration: 4 kafka brokers + 4 zookeeper
Topic Partiton: 1
Topic Replicas: 2
答案 0 :(得分:0)
这似乎在不降低群集的情况下起作用:
首先使用隐藏的0.8.1.1
功能删除损坏的主题kafka@kafka-3:~$ /opt/kafka/kafka_2.10-0.8.1.1/bin/kafka-run-class.sh kafka.admin.DeleteTopicCommand --zookeeper localhost:2181 --topic T_60036
重新创建主题
kafka@kafka-3:~$/opt/kafka/kafka_2.10-0.8.1.1/bin/kafka-topics.sh --create --topic T_60036 --zookeeper localhost:2181 --partitions 1 --replication-factor 2