An image

Corporate Blogs

Professional Life of an IT Consultant Interview with Valentin Crettaz
Written by

Thoughts on



Hi Mohit, before going to start Kafka, check the zookeeper status whether the zookeeper is running or not. Kafka is searching for zookeepers.

Hi ,
I’m getting an error “could not be established. Broker may not be available.”, it will come when kafka service is not running . My issue is whenever I try to list of topics, my kafka service has been stopped automatically and I’m getting an error
“Exception in thread “main” kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in the state: CONNECTING” in the terminal and in log file this “could not be established. The broker may not be available.

Yes! you have to install zookeeper and kafka in 3 servers. And, the configuration will be same in all servers(you have to follow the some unique rules like unique broker id in server.properties and unique Id of node in zookeeper.properties). We clearly explained about configurations please follow this.

Hi,
Just a doubt..
For production I need to setup 3 servers – server 1, server 2 , server 3 ( very similar to your example )
Should i install zookeeper and kafka in all these 3 servers also or only the zookeeper is enough ?
If yes will the config file ( zookeeper.properties and server.properties) be the same in all 3 servers ?
Please help me in this regard.
Thanks in advance !

Hi Akshay,
In the blog, I clearly explained how to set up a multiserver Kafka cluster between machines of various private IP addresses. If you are trying to use public IP, then the current node IP should be replaced with 0.0.0.0 in each node.
To configure zookeeper.properties, create a topic, start a producer and a consumer, I have already given examples.
If you are struggling anywhere, let us know we are always ready to help. Thank you!

how can I set up multiserver kafka cluster between machines of various public IP addresses?I can only configure server.properties for it but don’t know how to configure zookeeper.properties,create a topic ,start a producer and a consumer.

Hi Roopa,
Please define the appropriate Directory path dataDir=/tmp/zookeeper in zookeeper.properties file and check the myid file in that you have declared the unique id. And also you can check these below instructions,
The value of dataDir with the directory where you would like ZooKeeper to save its data and log respectively.
clientPort property, as the name suggests, is for the clients to connect to ZooKeeper Service.
x in server.x denotes the id of node. Each server.x row must have unique id. Each server is assigned an id by creating a file named myid, one for each server, which resides in that server’s data directory, as specified by the configuration file parameter dataDir.
Hope this will work, Thank You!

Leave a Comment


You have an Idea. We have the Solution.

We help business evolve with lates technologies and infrastructures tailored to their needs and market trends.