gliderlabs / registrator

Service registry bridge for Docker with pluggable adapters
http://gliderlabs.com/registrator
MIT License
4.66k stars 912 forks source link

Registrator fails to startup with zookeeper #354

Closed kunalvjti closed 8 years ago

kunalvjti commented 8 years ago

$ cat docker-compose.yml nginxplus: build: ./nginx container_name: nginx links:

zookeeper: image: jplock/zookeeper:latest container_name: zookeeper ports:

registrator: command: zookeeper://192.168.99.100:2181 image: gliderlabs/registrator:latest container_name: registrator links:

On doing 'docker-compose up -d' using the above file, registrator fails to start & i get the following error $ docker logs registrator 2016/02/24 04:58:09 Starting registrator v6 ... 2016/02/24 04:58:09 Unrecognized adapter:zookeeper://192.168.99.100:2181

Other 2 containers (nginx and zookeeper) were started successfully $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d27b2fe6b4c8 zookeeperdemo_nginx "nginx -g 'daemon off" 18 minutes ago Up 18 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:8080->8080/tcp, 443/tcp nginx dd39d3a1a2dd jplock/zookeeper:latest "/opt/zookeeper/bin/z" 18 minutes ago Up 18 minutes 2888/tcp, 0.0.0.0:2181->2181/tcp, 3888/tcp zookeeper

Am i missing something here ?

Thanks

kunalvjti commented 8 years ago

Any inputs on this please ?

progrium commented 8 years ago

@jmeichle??

jmeichle commented 8 years ago

I'll take a look at this soon

jmeichle commented 8 years ago
jmeichle@jkm-desktop:~/.gvm/pkgsets/go1.4/global/src/github.com/gliderlabs/registrator$ docker run --name=registrator --net=host --volume=/var/run/docker.sock:/tmp/docker.sock -it gliderlabs/registrator:latest zookeeper://localhost:2181
2016/03/02 21:12:27 Starting registrator v6 ...
2016/03/02 21:12:27 Unrecognized adapter:zookeeper://localhost:2181

I can recreate this. However, building the registrator binary and running it manually works:

jmeichle@jkm-desktop:~/.gvm/pkgsets/go1.4/global/src/github.com/gliderlabs/registrator$ DOCKER_HOST=unix:///var/run/docker.sock ./registrator zookeeper://localhost:2181
2016/03/02 16:14:26 Starting registrator  ...
2016/03/02 16:14:26 Using zookeeper adapter: zookeeper://localhost:2181
2016/03/02 16:14:26 Connected to 127.0.0.1:2181
2016/03/02 16:14:26 Authenticated: id=95471686666027015, timeout=10000
2016/03/02 16:14:26 Connecting to backend (0/0)
2016/03/02 16:14:26 Listening for Docker events ...

So I gotta figure out why its failing from the container

jmeichle commented 8 years ago

It also could be due to versions. the container indicates starting v6, where as running locally after a go build . does not.

jmeichle commented 8 years ago

https://github.com/gliderlabs/registrator/tree/v6 does not have zookeeper. That seems to be why. @progrium I was planning to push an update to the zookeeper backend anyway due to a silly oversight in publishing that affects usability. perhaps after that a release could be queued up so users can try it?

progrium commented 8 years ago

sure. people can use :master in the meantime to try it before release.

On Wed, Mar 2, 2016 at 3:16 PM, jmeichle notifications@github.com wrote:

https://github.com/gliderlabs/registrator/tree/v6 does not have zookeeper. That seems to be why. @progrium https://github.com/progrium I was planning to push an update to the zookeeper backend anyway due to a silly oversight in publishing that affects usability. perhaps after that a release could be queued up so users can try it?

— Reply to this email directly or view it on GitHub https://github.com/gliderlabs/registrator/issues/354#issuecomment-191434741 .

Jeff Lindsay http://progrium.com

jmeichle commented 8 years ago

Seems like a fair workaround.

I will file an issue about the refactor I want to do to the zookeeper plugin. It's a trivial change, regarding the path to published znodes including the private port for the service not the public, making it hard to support more than a single container.

jmeichle commented 8 years ago

I think this can be closed. The workaround being to use the master branch instead of latest for the registrator container.

kunalvjti commented 8 years ago

Thanks. Was able to get this working with :master

kunalvjti commented 8 years ago

@jmeichle: I have some followup questions related to the use of ZK backend with registrator. Could you please connect with me via email kunalvjti@gmail.com or ping me in the Glider Labs community slack channel (my slack name is kunal). Thanks