启动Kafka经纪人时出错

编程入门 行业动态 更新时间:2024-10-24 20:22:03
本文介绍了启动Kafka经纪人时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

昨天我成功地建立了Zookeeper和一名kafka经纪人.一切都按预期进行.我先关闭kafka(ctrl + c),然后再关闭zookeeper.

I was able to successfully set up zookeeper and one kafka broker yesterday. Everything worked as expected. I shut down kafka (ctrl + c) and then zookeeper.

今天我启动了zookeeper,并且当我启动kafka( bin/kafka-server-start.sh config/server0.properties )时,出现以下错误.我尝试了各种建议的补救措施(完全删除我的kafka安装并从头开始重新进行安装).我仍然遇到相同的错误.

Today I started zookeeper and when I started kafka (bin/kafka-server-start.sh config/server0.properties), I get the following error. I tried various remedies suggested (removing completely my kafka installation and doing it again from scratch). Still I get same error.

[2016-09-28 16:15:55,895] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable) java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/0. 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. at kafka.utils.ZkUtils.registerBrokerInZk(ZkUtils.scala:305) at kafka.utils.ZkUtils.registerBrokerInZk(ZkUtils.scala:291) at kafka.server.KafkaHealthcheck.register(KafkaHealthcheck.scala:70) at kafka.server.KafkaHealthcheck.startup(KafkaHealthcheck.scala:51) at kafka.server.KafkaServer.startup(KafkaServer.scala:244) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37) at kafka.Kafka$.main(Kafka.scala:67) at kafka.Kafka.main(Kafka.scala) [2016-09-28 16:15:55,896] INFO [Kafka Server 0], shutting down (kafka.server.KafkaServer)

所有在Mac中设置

推荐答案

在设置kafka和zookeeper多节点集群时,我遇到了同样的问题.

I have faced the same issue while setting up the kafka and zookeeper multinode cluster.

根本原因:

由于Zookeeper集成需要一些时间来设置,因此当我们启动kafka代理时,所有Zookeeper节点可能尚未加入Zookeeper集成.

As zookeeper ensemble takes some time to setup so when we start kafka brokers, all zookeeper nodes might have not joined zookeeper ensemble yet.

因此,可能是一个kafka节点连接到尚未集成的Zookeeper节点.

So It may be the case that one kafka node connected to a zookeeper node which is not yet in the ensemble.

另一个原因可能是kafka经纪人被杀而不是被杀.当您杀死kafka进程或崩溃时,它不会正确关闭其zookeeper连接.

Another reason can be kafka broker is killed instead of stopped. When you kill your kafka process or it crashes and it does not close its zookeeper connection correctly.

解决方案:

为避免这种情况,请确保在启动kafka经纪人之前,您的Zookeeper集成已启动并运行.

To avoid this situation make sure your zookeeper ensemble is up and running before starting kafka brokers.

在Zookeeper和kafka代理服务的启动和停止之间添加适当的等待时间.

Add proper waits between zookeeper and kafka broker services start and stop.

更多推荐

启动Kafka经纪人时出错

本文发布于:2023-10-19 18:06:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1508339.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:人时   经纪   Kafka

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!