Group coordinator lookup failed,The coordinator is not available问题

问题

kafka consumer 启动后 , 得到如标题的异常 .

查阅资料 , 得知是 __consumer_offsets 这个 topic 异常了 .
异常可能是 topic 被删除不存在了 , 也可能是 因为分区或其他原因 , 导致这个 topic 异常了 .

去 zookeeper 上看下这个 topic 是否存在 .

ls /brokers/topics
[__consumer_offsets , xx,xx]

1) __consumer_offsets 不存在

./kafka-topics.sh --zookeeper master:2181 --partitions 1 --replication-factor 1 --create --topic __consumer_offsets

topic 不存在的 , 直接创建一个 .

2) __consumer_offsets 存在

我的就是这个问题 , topic 存在 , 但是在 kafka 迁移过程中产生了异常 .

  1. 那么需要先把 kafka 停掉 .
  2. 删除 zookeeper 里的 topic
# 删除 node 信息
deleteall /brokers/topics/__consumer_offsets
# 删除 node
delete /brokers/topics/__consumer_offsets
  1. 重启 kafka .

理论上重启 kafka , consumer 自动上线 , 会自动创建__consumer_offsets topic , 如果没有的话, 照上一步 , 手动创建一个 .

posted @ 2022-10-28 15:58  孙行者、  阅读(339)  评论(0编辑  收藏  举报