Unable to connect broker - kafka Tool

12,482

Solution 1

For better visibility (even already commented the same in early days thread)

In my case, I got to know when I used Kafkatool from my local machine, tool tris to find out Kafka broker port which was blocked from my cluster admins for my local machine, that is the reason I was not able to connect.

Resolution:

Either ask the admin to open the port for intranet if they can, if they can not you can use tunnelling for your testing purpose or time being for your port.

Hope this would help a few.

Solution 2

I had the same issue on my MacBook Pro. The tool was using "tshepo-mbp" as the hostname which it could not resolve. To get it to work I added 127.0.0.1 tshepo-mbp to the /etc/hosts file.

Solution 3

This issue occurs if you have not set listeners and advertised.listeners property in server.properties file.

For Ex: config/server.properties

...
listeners=PLAINTEXT://:9092
...
advertised.listeners=PLAINTEXT://<public-ip/host-name>:9092
...

Solution 4

kafka tool is most likely using the hostname to connect to the broker and cannot reach it. You maybe connecting to the zookeeper host by IP address but make sure you can connect/ping the host name of the broker from the machine running the kafka tool.

If you cannot ping the broker either fix the network issues or as a workaround edit the host file on your client to let it know how to reach the broker by its name

Solution 5

To fix this issue, we need to change the server.properties file.

$ vim /usr/local/etc/kafka/server.properties

Here update the listeners value from

listeners=PLAINTEXT://:9092

to

listeners=PLAINTEXT://localhost:9092

source:https://medium.com/@Ankitthakur/apache-kafka-installation-on-mac-using-homebrew-a367cdefd273

Share:
12,482

Related videos on Youtube

Indrajeet Gour
Author by

Indrajeet Gour

Here for knowing things better then mine and also spreading my ideas and knowledge which could make more scene to others.

Updated on September 14, 2022

Comments

  • Indrajeet Gour
    Indrajeet Gour over 1 year

    I am facing below error message when i was trying to connect and see the topic/consumer details of one of my kafka clusters we have.

    we have 3 brokers in the cluster which I able to see but the topic and its partitions.

    enter image description here

    Note : I have kafka 1.0 and kafka tool version is 2.0.1

    • Robin Moffatt
      Robin Moffatt over 5 years
      If it works with those, then it sounds like an issue specific to the tool you're using maybe.
  • Yugandhar Pathi
    Yugandhar Pathi about 2 years
    Thanks a lot!! Your answer is of great help!!
  • swapnil7
    swapnil7 about 2 years
    this resolved the issue for me