15

I have setup a multi node setup for kafka, everything seems to work well and show no error logs unless i try to push message to one producer. I get a message:

Bootstrap broker host2:2181 disconnected (org.apache.kafka.clients.NetworkClient)

and on the zookeeper logs i am getting:

"WARN Exception causing close of session 0x0 due to java.io.IOException:
 Unreasonable length = 1701969920 (org.apache.zookeeper.server.NIOServerCnxn)"

i cleaned up my data directory which is "/var/zookeeper/data" still no luck.

Any help on the the would be much appriciated

Mateusz Piotrowski
  • 8,029
  • 10
  • 53
  • 79
vaibhav
  • 3,929
  • 8
  • 45
  • 81

1 Answers1

44

Vaibhav looking at this line (Bootstrap broker host2:2181) looks like you are trying to connect to zookeeper instance rather than broker instance. By Default Kafka broker runs on 9092 port. So producer and consumer should be created as per below command

Producer :

bin/kafka-console-producer.sh --broker-list host1:9092,host2:9092 \
  --topic "topic_name"

Consumer:

bin/kafka-console-consumer.sh --bootstrap-server <host_ip_of_producer>:9092 \
  --topic "topic_name" --from-beginning
Mateusz Piotrowski
  • 8,029
  • 10
  • 53
  • 79
Nikhil
  • 772
  • 8
  • 16