3
votes

I setup Kafka and Zookeeper on my local machine and I would like to use Kafdrop as UI. I tried running with docker command below:

docker run -d --rm -p 9000:9000 \
    -e KAFKA_BROKERCONNECT=<localhost:9092> \
    -e JVM_OPTS="-Xms32M -Xmx64M" \
    -e SERVER_SERVLET_CONTEXTPATH="/" \
    obsidiandynamics/kafdrop

and I get -bash: https://locahost:9092: No such file or directory

When I remove the KAFKA_BROKERCONNECT parameter, the application run but I got error below:

[AdminClient clientId=kafdrop-admin] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
2020-07-22 09:39:29.108  WARN 1 [| kafdrop-admin] o.a.k.c.NetworkClient 

I did setup Kafka Server's listener setting to this but did not help.

listeners=PLAINTEXT://localhost:9092

I found this similar issue on GitHub but couldn't understand most of the answers.

2
Are you running Kafka & zookeeper in Docker or Standalone - Jagadesh
No, they are both installed locally - NothingBox
Then you can build the code available github and run the jar. - Jagadesh
Running JAR file works. I wanted to use the docker image though. - NothingBox

2 Answers

3
votes

Kafka is not HTTP-based. You do not need a schema protocol to connect to Kafka, and angle brackets do not need used.

You also cannot use localhost, as that is Kafdrop container, not Kafka.

I suggest you use Docker Compose with Kafdrop and Kafka

1
votes

I followed what @OneCricketeer said in his answer and everything worked perfectly Here what I did :

  • I downloaded the compose file from GitHub the link above or Click here

  • Run the compose file by going to the directory where the file exists and run it using cmd docker-compose up

  • Stop all your kafka server and Zookeeper because everything going to be downloaded with the docker-compose command

  • after go to http://localhost:9000/ and Voila Kafdrop dashboard