31z4 / zookeeper-docker

Docker image packaging for Apache Zookeeper
MIT License
284 stars 244 forks source link

Update docker-entrypoint.sh #70

Closed divgo closed 5 years ago

divgo commented 5 years ago

re-add clientPort=2181 - which was missing.

31z4 commented 5 years ago

As per official documentation

image

Please elaborate why do you think this setting is missing.

plutarcian commented 5 years ago

I am also facing the same. with the client port missing, the server starts but does not listen to any port. workaround is to mount your own complete zoo.cfg with the client port which means NONE of the environment variables are used ( as zoo.cfg exists ).

Perhaps we should also allow the port to be set in the environment instead of hard coding to 2181

31z4 commented 5 years ago

By default the image is configured to listen the default client port:

$ docker run --name my_zookeeper -d -p 2181:2181 zookeeper:latest
1a4b5df5409b19209b59bb32b7647a7b782db76f0be8e1fa52463e47931a7766
$ echo "ruok" | nc localhost 2181
ruok is not executed because it is not in the whitelist.

If you need to change the client port value it's doable using ZOO_SERVERS environment variable:

$ docker run --name my_zookeeper -d -p 31337:31337 -e "ZOO_SERVERS=server.1=localhost:2888:3888;31337" zookeeper:latest
4e5d51c5966f521caf6106efaac9777fd8125df562341128b45408e59f189b1d
$ echo "ruok" | nc localhost 31337
ruok is not executed because it is not in the whitelist.
31z4 commented 5 years ago

Closing it because the PR seems to be inactive for quite some time now.