I am trying to setup multi node Kafka-0.8.2.2
cluster with 1 Producer, 1 consumer and 3 brokers all on different machines.
While creating topic on producer
, I am getting error as org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /brokers/ids
. Complete console output is available here. There is no error in Kafka Producer
's log.
Command I am using to run Kafka
is:
./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic edwintest
Note: Zookeeper service is running on all the servers, and all three brokers are having Kafka servers running on them (Only Brokers need Kafka Server. Right?).
Configuration of my producer.properties is as:
metadata.broker.list=<IP.OF.BROKER.1>:9092,<IP.OF.BROKER.2>:9092,<IP.OF.BROKER.3>:9092
producer.type=sync
compression.codec=none
serializer.class=kafka.serializer.DefaultEncoder
Below are some of the many articles I was using as reference:
答案 0 :(得分:1)
乍一看,您似乎正在向当地的动物园管理员调用创建主题,而该动物园管理员并不知道您的任何卡夫卡经纪人。你应该致电Text
答案 1 :(得分:0)
问题是因为我试图连接到localhost的zookeeper
。我的理解是,zookeeper需要在生产者,消费者和Kafka经纪人身上运行,并且在生产者之间进行沟通 - &gt;经纪人和经纪人 - &gt;消费者通过zookeeper。但这是不正确的。实际上:
Zookeeper 和 Kafka 服务器应仅在代理服务器上运行。在创建主题或将内容发布到主题时,任何Kafka代理的公共DNS都应与 - zookeeper 选项一起传递。无需在生产者或消费者实例上运行Kafka服务器。
正确的命令将是:
./bin/kafka-topics.sh --create --zookeeper <Public-DNS>:<PORT> --replication-factor 1 --partitions 3 --topic edwintest
其中: Public-DNS 是任何Kafka代理的DNS, PORT 是zookeeper服务的端口。