按照官网gettingStarted ->http://kafka.apache.org/documentation.html#gettingStarted ,我单独安装的zookeeper, 启动了三个boroker。创建了一个topic,按照官网的步骤发送消息的时候,总是出现LeaderNotAvailableException异常。
部分错误信息:
[2015-04-11 14:14:15,076] WARN Error while fetching metadata [{TopicMetadata for topic my-replicated-topic ->
No partition metadata for topic my-replicated-topic due to kafka.common.LeaderNotAvailableException}] for topic [my-replicated-topic]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2015-04-11 14:14:15,076] ERROR Failed to collate messages by topic, partition due to: Failed to fetch topic metadata for topic: my-replicated-topic (kafka.producer.async.DefaultEventHandler)
[2015-04-11 14:14:15,183] WARN Error while fetching metadata [{TopicMetadata for topic my-replicated-topic ->
No partition metadata for topic my-replicated-topic due to kafka.common.LeaderNotAvailableException}] for topic [my-replicated-topic]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2015-04-11 14:14:15,186] ERROR Failed to send requests for topics my-replicated-topic with correlation ids in [0,8] (kafka.producer.async.DefaultEventHandler)
[2015-04-11 14:14:15,188] ERROR Error in handling batch of 1 events (kafka.producer.async.ProducerSendThread)
kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries.
at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:90)
at kafka.producer.async.ProducerSendThread.tryToHandle(ProducerSendThread.scala:105)
at kafka.producer.async.ProducerSendThread$$anonfun$processEvents$3.apply(ProducerSendThread.scala:88)
at kafka.producer.async.ProducerSendThread$$anonfun$processEvents$3.apply(ProducerSendThread.scala:68)
at scala.collection.immutable.Stream.foreach(Stream.scala:594)
at kafka.producer.async.ProducerSendThread.processEvents(ProducerSendThread.scala:67)
at kafka.producer.async.ProducerSendThread.run(ProducerSendThread.scala:45)
在stackoverflow上面找到了一个类似的问题http://stackoverflow.com/questions/23228222/running-into-leadernotavailableexception-when-using-kafka-0-8-1-with-zookeeper-3 ,按照下面的回答说配置有问题,我停掉kafka和zookeeper清除掉kafka的log和zookeeper的内容。重新启动但还是有上述问题。
各位有遇到这个问题吗?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.