Inspired from
- https://github.com/democracyworks/consul-coreos
- https://gist.github.com/divideandconquer/08405a4fb597319d3c3e
Since Consul brings interesting features (service catalog, DNS interface, watches) that etcd does not support, it is nice to have a Consul cluster too.
- Up and running autonomous Consul cluster
- DNS service
- Automatic service declaration via Registrator
- CoreOS cluster with etcd and fleet running
- /etc/environment file existing with
COREOS_PUBLIC_IPV4
variable defined
git clone git@github.com:vvanholl/consul4coreos.git
cd consul4coreos
./install.sh
Note that you can give options to ./install.sh, like --registrator
to also add Registrator service, or --join <node>
to join an existing cluster
git clone git@github.com:vvanholl/consul4coreos.git
cd consul4coreos
Open service file in your favorite editor
vi consul.service
and modify these lines :
Environment=DOCKER_REPOSITORY=gliderlabs/consul-server
Environment=DOCKER_CONTAINER=consul
Environment=CONSUL_DATACENTER=dc1
fleetctl submit consul.service
fleetctl start consul.service
fleetctl submit registrator.service
fleetctl start registrator.service