Zookeeper具有KeeperException但Kafka能够创建主题并生成/消费

时间:2015-05-27 23:56:43

标签: apache-zookeeper apache-kafka

我最近在单节点CDH 5设置上设置Kafka,目的是在移动到真实集群之前在单个节点上播放它。最初,我刚用kafka服务器启动了zookeeper服务器,一切都很好。我可以看到zookeeper在2181运行,而Kafka在9092运行。然后我创建了一个主题,并启动了消费者和生产者,消费者可以看到生产者发送的消息。

幸福的是,我带着动物园管理员的日志搬到了标签,看到了这个:

[2015-05-27 16:46:07,016] INFO Got user-level KeeperException when processing sessionid:0x14d97bf0a020002 type:create cxid:0x2 zxid:0x1f txntype:-1 reqpath:n/a Error Path:/consumers/test-consumer-group/ids Error:KeeperErrorCode = NoNode for /consumers/test-consumer-group/ids (org.apache.zookeeper.server.PrepRequestProcessor)
[2015-05-27 16:46:07,021] INFO Got user-level KeeperException when processing sessionid:0x14d97bf0a020002 type:create cxid:0x3 zxid:0x20 txntype:-1 reqpath:n/a Error Path:/consumers/test-consumer-group Error:KeeperErrorCode = NoNode for /consumers/test-consumer-group (org.apache.zookeeper.server.PrepRequestProcessor)
[2015-05-27 16:46:07,306] INFO Got user-level KeeperException when processing sessionid:0x14d97bf0a020002 type:create cxid:0x19 zxid:0x24 txntype:-1 reqpath:n/a Error Path:/consumers/test-consumer-group/owners/test Error:KeeperErrorCode = NoNode for /consumers/test-consumer-group/owners/test (org.apache.zookeeper.server.PrepRequestProcessor)
[2015-05-27 16:46:07,307] INFO Got user-level KeeperException when processing sessionid:0x14d97bf0a020002 type:create cxid:0x1a zxid:0x25 txntype:-1 reqpath:n/a Error Path:/consumers/test-consumer-group/owners Error:KeeperErrorCode = NoNode for /consumers/test-consumer-group/owners (org.apache.zookeeper.server.PrepRequestProcessor)
[2015-05-27 16:47:06,961] INFO Got user-level KeeperException when processing sessionid:0x14d97bf0a020002 type:setData cxid:0x24 zxid:0x29 txntype:-1 reqpath:n/a Error Path:/consumers/test-consumer-group/offsets/test/0 Error:KeeperErrorCode = NoNode for /consumers/test-consumer-group/offsets/test/0 (org.apache.zookeeper.server.PrepRequestProcessor)
[2015-05-27 16:47:06,963] INFO Got user-level KeeperException when processing sessionid:0x14d97bf0a020002 type:create cxid:0x25 zxid:0x2a txntype:-1 reqpath:n/a Error Path:/consumers/test-consumer-group/offsets Error:KeeperErrorCode = NoNode for /consumers/test-consumer-group/offsets (org.apache.zookeeper.server.PrepRequestProcessor)

看起来zookeeper无法找到节点。 。 。东西。但是,如果是这样的话,为什么我的所有命令都有效?我能够创建一个主题,然后为其订阅一些数据,而订阅它的消费者也获得数据?

如果有帮助,我的zookeeper版本是3.4.6,我的Kafka版本是0.8.2.1。哦,路径/ tmp / zookeeper存在。

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题

Exiting due to: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /consumers/test-group/offsets/packets/0.

我解决了问题,你确保你的zookeeper和kafka经纪人正在运行, 是的,你可以创建主题和生产者消费者将工作。要解决错误,必须让消费者群体和消费者群体使用该主题

在您的情况下,它将成为消费者群体test-consumer-group的消费者,并被归入主题Test