Open MrXu opened 7 years ago
Answer my own question.
The problem is with Docker not Kafka-manager.
Basically, java.net.ConnectException: Connection refused
says either the server is not started or the port is not listening.
The default ZK_HOST is the localhost:2181 inside docker container. However, my zookeeper is running in the docker host machine at localhost:2181.
So, changing the docker run command to the following will enable container to use host's network:
docker run -it --rm --net="host" -p 9000:9000 -e ZK_HOSTS="localhost:2181" sheepkiller/kafka-manager
Interestingly is that if you do what you suggest, Kafka Manager is able to connect to ZooKeeper, but you will not be able to connect to the UI anymore. Or, at least this is what is happening to me. I have three docker containers, one runs km, one kafka and one zookeeper.
Addition: in my specific scenario, the containers were missing a link. So, defined a network used by both and giving a name to containers, it all worked perfectly.
@brunoripa he is running kafka/zookeeper on the host and not in another container. Your solution is appropriate for a kafka instance running in docker.
@brunoripa can you elaborate how you define a network to make the UI work? Thanks.
I have Zookeeper and Kafka running in localhost. When I start the docker container with
it throws error
Both zookeeper and kafka are running fine and listening to correct ports. What might be the cause?