Sign inSign up

corbinu/consul-mongo

By corbinu

•Updated about 10 years ago

Image
0

764

corbinu/consul-mongo repository overview

⁠Consul Mongo

This Docker container is setup to run Mongo with Consul for service discovery and health monitoring.

It has also been optimized to run on Joyent's Triton⁠, however it will always also support strait Docker and boot2docker.

⁠Running

It can be run on its own simply via:

docker run -d  -p 8400 -p 8500 -p 8600 --name consul progrium/consul -server -bootstrap -ui-dir /ui
docker run -d --name m1 --link consul:consul corbinu/consul-mongo

docker exec -it m1 mongo-bootstrap

Consul UI will be available on port mapped to 8500

⁠Consul notes

Bootstrapping⁠, Consul clusters⁠, and the details about adding and removing nodes⁠. The CLI⁠ and HTTP⁠ API are also documented.

Check for registered instances of a named service⁠

curl -v http://consul:8500/v1/catalog/service/mongo | json -aH ServiceAddress

Register an instance of a service⁠

export MYIP=$(ip addr show eth0 | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
curl http://consul:8500/v1/agent/service/register -d "$(printf '{"ID": "mongo-%s","Name": "mongo","Address": "%s"}' $MYIP $MYIP)"

Tag summary

Content type

Image

Digest

sha256:428d2fe8c…

Size

97.5 MB

Last updated

about 10 years ago

docker pull corbinu/consul-mongo