项目中kafka异常重启导致输出日志报错如下:

[2022-11-04 08:24:31,508] FATAL [KafkaServer id=1] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/1. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering.

解决办法

进入bin目录执行zkCli.sh删除被注册的id即可。

root@c4719e81ea3b:/opt/zookeeper-3.4.9# cd bin
root@c4719e81ea3b:/opt/zookeeper-3.4.9/bin# ./zkCli.sh
Connecting to localhost:2181
[zk: localhost:2181(CONNECTED) 0] ls /brokers/ids
[1]
[zk: localhost:2181(CONNECTED) 1] rmr /brokers/ids/1
[zk: localhost:2181(CONNECTED) 2] ls /brokers/ids   
[]
[zk: localhost:2181(CONNECTED) 3] quit
Quitting...

重启kafka后恢复正常

END

本文标题:kafka重启后提示/brokers/ids/1已被注册问题解决

本文作者:宇宙最帅的男人

本文链接:https://lolicp.com/linux/202204460.html

版权声明:转载或者引用本文内容请注明来源及原作者,本文著作权归 (lolicp.com) 所有。

除非另有说明,本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

最后修改:2022 年 11 月 04 日
如果觉得我的文章对你有用,请随意赞赏