Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Kafka is not working / Warning while sending messages

avatar
Explorer

Hi, I recently started to read up in kafka. Now I would like to start working on cloudera but I have some problems with sending messages. I created a a topic with following code: $ kafka-topics --create --zookeeper 127.0.0.1:2181 --replication-factor 1 --partitions 1 --topic test --> it worked then i tried to send some messages with following code: $ kafka-console-producer --broker-list 127.0.0.1:2181 --topic test --> doesnt work but as soon I write a message, i get several Warnings and an Error message: WARN [Producer clientId=console-producer] Bootstrap broker 127.0.0.1:2181 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient) ... ERROR Error when sending message to topic test with key: null, value: 9 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback) org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms. Does someone can help me to fix this problem?

1 ACCEPTED SOLUTION

avatar
Mentor
Your port for broker is incorrect in that command, you're supplying the
ZooKeeper port of 2181 in an argument that requires the Broker client port
of 9092.

Follow our guide at
https://www.cloudera.com/documentation/kafka/latest/topics/kafka_command_line.html
for using the command line tools.

View solution in original post

2 REPLIES 2

avatar
Contributor

Hello,

 

What version of Cloudera Kafka/CDH are you testing?

 

Can you do the following:
kafka-topics --zookeeper <zkhost>:2181 --list
kafka-topics --zookeeper <zkhost>:2181 --describe --topic test

 

Cheers!
Manuel

 

avatar
Mentor
Your port for broker is incorrect in that command, you're supplying the
ZooKeeper port of 2181 in an argument that requires the Broker client port
of 9092.

Follow our guide at
https://www.cloudera.com/documentation/kafka/latest/topics/kafka_command_line.html
for using the command line tools.