You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.
I have Zookeeper and Kafka running in localhost.
When I start the docker container with
docker run -it --rm -p 9000:9000 -e ZK_HOSTS="localhost:2181" sheepkiller/kafka-manager
it throws error
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_111]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_111]
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081) ~[org.apache.zookeeper.zookeeper-3.4.6.jar:3.4.6-1569965]
Both zookeeper and kafka are running fine and listening to correct ports. What might be the cause?
The text was updated successfully, but these errors were encountered:
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.
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?
The text was updated successfully, but these errors were encountered: