Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kafka Multi Node setup "Unreasonable length" in Zookeeper logs

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

like image 642
vaibhav Avatar asked Dec 28 '16 12:12

vaibhav


People also ask

Is Zookeeper deprecated in Kafka?

Confluent views ZooKeeper's deprecation as an important move for the Kafka community, said Jun Rao, Kafka's co-creator and co-founder of Confluent. “It makes deployment/operation much simpler and improves the scalability by a factor of 10 because of more efficient handling of metadata.

Does Kafka 3.1 need zookeeper?

In Kafka architecture, Zookeeper serves as a centralized controller for managing all the metadata information about Kafka producers, brokers, and consumers. However, you can install and run Kafka without Zookeeper.

What is the role of zookeeper in a Kafka cluster?

If we must define the role of Zookeeper in a few words, we can say that Zookeeper acts a Kafka cluster coordinator that manages cluster membership of brokers, producers, and consumers participating in message transfers via Kafka. It also helps in leader election for a Kafka topic.


1 Answers

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
like image 60
Nikhil Avatar answered Jan 02 '23 20:01

Nikhil