zoonavigator
zoonavigator copied to clipboard
Using external ZooKeeper instance (in OS other than Linux)
If wanting to connect to a local ZooKeeper on 2181 outside of the docker container, we cannot use network: host mode. Here is how I was able to get around this, remove net=host mode and open 9000 on the host machine:
docker run \
-d -p 9000:9000 \
--name zoonavigator \
--restart unless-stopped \
elkozmon/zoonavigator:latest
And use the connection string docker.for.mac.host.internal:2181
(varies by operating system, see this answer: https://stackoverflow.com/a/43541732/7983959
Wanted to share here in case others experience this issue, it was not straightforward to determine the issue
Thanks for sharing this, I will probably link this issue in the docs too.
This configuration worked for me when deploying to local Kubernetes with docker stack deploy
:
zookeeper1:
image: bitnami/zookeeper:latest
hostname: zookeeper1
ports:
- "2181:2181"
environment:
ALLOW_ANONYMOUS_LOGIN: "yes"
volumes:
- zookeeper1-data:/bitnami/zookeeper
zoonavigator:
image: elkozmon/zoonavigator:0.7.1
ports:
- "8000:8000"
environment:
HTTP_PORT: 8000
AUTO_CONNECT_CONNECTION_STRING: zookeeper1:2181
volumes:
zookeeper1-data:
docker.for.mac.host.internal
I read this DNS string is deprecated and is now just host.docker.internal
https://forums.docker.com/t/understanding-the-docker-for-mac-localhost-behavior/41921/4
Or just run it outside Docker with this script ->
wget https://www.dropbox.com/s/zaea4o5cdqlsrk0/zoonavigator-0.1.0.tar.bz2?dl=1 -O zoonavigator-0.1.0.tar.bz2
tar xjf zoonavigator-0.1.0.tar.bz2
zoonavigator-0.1.0/bin/zoonavigator-play \
'-Dplay.http.secret.key=9z34aAn7k?6Z?iarawMxILR1CTF:G2gf:92lmtabG@5142AB:R5W11l2:N:::Cy@' \
-Dplay.server.http.port=9001
NOTE: if you want to update to a new version, just follow the build steps at https://zoonavigator.elkozmon.com/en/latest/development.html NOTE2: obviously for security reasons change the secret key to a new random you want
By the way, thanks for ZooNavigator, it's a great tool !! ;) :) ... and please don't forget to sponsor the author at -> https://www.paypal.me/elkozmon