Forked from jmshal/create-multi-host-swarm-digitalocean.sh
Last active
April 3, 2016 13:56
-
-
Save relvacode/6f2eae62ad78c7b2102b2165237d791c to your computer and use it in GitHub Desktop.
Setup a Docker Swarm multi-host cluster on DigitalOcean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-machine create \ | |
--driver=digitalocean \ | |
--digitalocean-access-token=$DO_TOKEN \ | |
--digitalocean-size=512mb \ | |
--digitalocean-region=lon1 \ | |
--digitalocean-private-networking=true \ | |
swarm-consul | |
docker $(docker-machine config swarm-consul) run -d \ | |
--net=host progrium/consul --server -bootstrap-expect 1 | |
kvip=$(docker-machine ip swarm-consul) | |
docker-machine create \ | |
--driver=digitalocean \ | |
--digitalocean-access-token=$DO_TOKEN \ | |
--digitalocean-size=512mb \ | |
--digitalocean-region=lon1 \ | |
--digitalocean-private-networking=true \ | |
--swarm \ | |
--swarm-master \ | |
--swarm-discovery consul://${kvip}:8500 \ | |
--engine-opt "cluster-store consul://${kvip}:8500" \ | |
--engine-opt "cluster-advertise eth1:2376" \ | |
swarm | |
docker-machine create \ | |
--driver=digitalocean \ | |
--digitalocean-access-token=$DO_TOKEN \ | |
--digitalocean-size=512mb \ | |
--digitalocean-region=lon1 \ | |
--digitalocean-private-networking=true \ | |
--swarm \ | |
--swarm-discovery consul://${kvip}:8500 \ | |
--engine-opt "cluster-store consul://${kvip}:8500" \ | |
--engine-opt "cluster-advertise eth1:2376" \ | |
lon1-node-1 | |
eval $(docker-machine env --swarm swarm) | |
docker info |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment