码迷,mamicode.com
首页 > 其他好文 > 详细

kafkakafka_2.10-0.8.2.1+zookeeper-3.4.6 创建topic一个小问题

时间:2015-05-28 14:26:09      阅读:2040      评论:0      收藏:0      [点我收藏+]

标签:kafka zookeeper 创建topic

kafka 创建topic时出现如下异常:

Error while executing topic command org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /brokers/ids
org.I0Itec.zkclient.exception.ZkNoNodeException: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /brokers/ids
 at org.I0Itec.zkclient.exception.ZkException.create(ZkException.java:47)
 at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:685)
 at org.I0Itec.zkclient.ZkClient.getChildren(ZkClient.java:413)
 at org.I0Itec.zkclient.ZkClient.getChildren(ZkClient.java:409)
 at kafka.utils.ZkUtils$.getChildren(ZkUtils.scala:462)
 at kafka.utils.ZkUtils$.getSortedBrokerList(ZkUtils.scala:78)
 at kafka.admin.AdminUtils$.createTopic(AdminUtils.scala:170)
 at kafka.admin.TopicCommand$.createTopic(TopicCommand.scala:93)
 at kafka.admin.TopicCommand$.main(TopicCommand.scala:55)
 at kafka.admin.TopicCommand.main(TopicCommand.scala)
Caused by: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /brokers/ids
 at org.apache.zookeeper.KeeperException.create(KeeperException.java:111)
 at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
 at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1472)
 at org.apache.zookeeper.ZooKeeper.getChildren(ZooKeeper.java:1500)
 at org.I0Itec.zkclient.ZkConnection.getChildren(ZkConnection.java:99)
 at org.I0Itec.zkclient.ZkClient$2.call(ZkClient.java:416)
 at org.I0Itec.zkclient.ZkClient$2.call(ZkClient.java:413)
 at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:675)
 ... 8 more


在之前的版本中一直没有这样问题,当kafka安装成功时通过集群查看一切都是正常的,但是创建topic确始终提示找不到节点,一开始是用如下命令创建的,这是照 前文档和其它资料做的:

 kafka-topics.sh --create --topic firsttopic --replication-factor 2 --partitions 2 --zookeeper slave1:2181       用这个命令始报上述异常。最后试着把他zookeeper集群全路径写上,结果就成功创建了,用如下命令: 

kafka-topics.sh --create --topic firsttopic --replication-factor 2 --partitions 2 --zookeeper slave1:2181/kafka


本文出自 “JAVAWEB” 博客,请务必保留此出处http://472053211.blog.51cto.com/3692116/1655844

kafkakafka_2.10-0.8.2.1+zookeeper-3.4.6 创建topic一个小问题

标签:kafka zookeeper 创建topic

原文地址:http://472053211.blog.51cto.com/3692116/1655844

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!