Reply
Explorer
Posts: 19
Registered: ‎12-02-2014
Accepted Solution

No brokers found in ZK

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

Cloudera Employee
Posts: 273
Registered: ‎01-09-2014

Re: No brokers found in ZK

[ Edited ]

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

Explorer
Posts: 19
Registered: ‎12-02-2014

Re: No brokers found in ZK

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

Cloudera Employee
Posts: 273
Registered: ‎01-09-2014

Re: No brokers found in ZK

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
Explorer
Posts: 19
Registered: ‎12-02-2014

Re: No brokers found in ZK

Hi Pd,

 

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

 

Thanks,

Silaphet

Cloudera Employee
Posts: 114
Registered: ‎03-01-2016

Re: No brokers found in ZK

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).
Explorer
Posts: 13
Registered: ‎11-22-2016

Re: No brokers found in ZK

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.

Cloudera Employee
Posts: 273
Registered: ‎01-09-2014

Re: No brokers found in ZK

What does the output of:

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

 

show?

 

-pd

Explorer
Posts: 13
Registered: ‎11-22-2016

Re: No brokers found in ZK

hi,
I found the mistake . Thanks for being there for a fellow programmer
Highlighted
Explorer
Posts: 13
Registered: ‎11-22-2016

Re: No brokers found in ZK

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

Announcements
New solutions