Support Questions

Find answers, ask questions, and share your expertise

No brokers found in ZK

avatar

Hi,

 

I'm testing Kafka sending messages by running below commands from seperate terminals.

 

bin/kafka-console-producer --broker-list localhost:9092 --topic kafkatest

This is a message

This is another message

 

On another terminal:

bin/kafka-console-consumer --zookeeper localhost:2181 --topic kafkatest --from-beginning

No brokers found in ZK.

 

Why the above messages don't show up on consumer terminal? This is CDH5.5.2 with Parcel deployment. 

What am I missing on CDH/CM configurations?

 

Thanks very much,

Silaphet

1 ACCEPTED SOLUTION

avatar

Hi Pd,

 

Yes, extra space was the root cause. Thanks very much for great trick.

 

Thanks,

Silaphet

View solution in original post

9 REPLIES 9

avatar

What is the value of your "ZooKeeper Root" set to in the kafka service configuration?
If it is set to something like "/kafka", you'll need to specify that in your zk string:

bin/kafka-console-consumer --zookeeper localhost:2181 /kafka --topic kafkatest --from-beginning

What version of kafka parcel are you using?

 

-pd

avatar

Hi,

 

Sorry for the delay. The "Zookeeper Root" is /kafa. I ran below command still no luck.

 

bin/kafka-console-consumer --zookeeper localhost:2181 /kafka --topic kafkatest --from-beginning

 

I tried FQN instead of localhost still no luck. Tried different Zookeeper node still the same. The Kafka version is 

 

KAFKA-2.0.1-1.2.0.1.p0.5

 

Please let me if there is another option to try.

 

Thanks,
Silaphet

avatar
Please confirm, there should be no space between localhost:2181 and /kafka. The zk option should be:
--zookeeper localhost:2181/kafka

My apologies, it appears I had a typo in my original recommendation.

-pd

avatar

Hi Pd,

 

Yes, extra space was the root cause. Thanks very much for great trick.

 

Thanks,

Silaphet

avatar
Expert Contributor
Hi,
Are you using CM 5.5.2?

To use Cloudera Kafka 2.x , you have to have CM 5.5.3 or above:
http://www.cloudera.com/documentation/kafka/latest/topics/kafka_requirements.html

I do see others encountering different kind of issues when their Kafka 2.x
is deployed/managed by CM version <= 5.5.2 (unsupported).

avatar
Rising Star

i came across this problem too.

I have zookeeper and kafka in seperate hosts.

i ran these commands:

bin/kafka-server-start.sh config/server.properties
bin/kafka-topics.sh --create --zookeeper server1:2181 --replication-factor 1 --partitions 1 --topic mobile_events

This has created topics in the kafka dir.

 

bin/kafka-console-producer.sh --broker-list server1:9092 --topic mobile_events.

This opens a terminal to type in the messages, but the messages are not being saved in the topics as i cheked the kafka data dir.

Finally,

bin/kafka-console-consumer.sh --zookeeper server1:2181 --topic mobile_events --from-beginning

Is throwing "No brokers fround in the ZK" log to the console.

 

Can you help me with fixing the issue.

Thanks in advance.

avatar

What does the output of:

kafka-topics --describe --zookeeper server1:2181

 

show?

 

-pd

avatar
Rising Star
hi,
I found the mistake . Thanks for being there for a fellow programmer

avatar
Rising Star

i was pointinn to a wrong broker so the zk was unable to find the topics