Last active
March 16, 2023 13:22
-
-
Save jmshal/77d6b3ba7c6c50de22eb to your computer and use it in GitHub Desktop.
Setup a Docker Swarm multi-host cluster on DigitalOcean
This file contains hidden or 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=nyc3 \ | |
--digitalocean-private-networking=true \ | |
--digitalocean-image=ubuntu-15-04-x64 \ | |
docker-swarm-kv-store | |
docker $(docker-machine config docker-swarm-kv-store) run -d \ | |
--net=host progrium/consul --server -bootstrap-expect 1 | |
kvip=$(docker-machine ip docker-swarm-kv-store) | |
docker-machine create \ | |
--driver=digitalocean \ | |
--digitalocean-access-token=$DO_TOKEN \ | |
--digitalocean-size=2gb \ | |
--digitalocean-region=nyc3 \ | |
--digitalocean-private-networking=true \ | |
--digitalocean-image=ubuntu-15-04-x64 \ | |
--swarm \ | |
--swarm-master \ | |
--swarm-discovery consul://${kvip}:8500 \ | |
--engine-opt "cluster-store consul://${kvip}:8500" \ | |
--engine-opt "cluster-advertise eth1:2376" \ | |
docker-swarm-master | |
docker-machine create \ | |
--driver=digitalocean \ | |
--digitalocean-access-token=$DO_TOKEN \ | |
--digitalocean-size=2gb \ | |
--digitalocean-region=nyc3 \ | |
--digitalocean-private-networking=true \ | |
--digitalocean-image=ubuntu-15-04-x64 \ | |
--swarm \ | |
--swarm-discovery consul://${kvip}:8500 \ | |
--engine-opt "cluster-store consul://${kvip}:8500" \ | |
--engine-opt "cluster-advertise eth1:2376" \ | |
docker-swarm-agent-1 | |
eval $(docker-machine env --swarm docker-swarm-master) | |
docker info |
Nowadays ubuntu-16-04-x64
is the supported version. Thanks for sharing!
Have you used Swarm Mode yet? It's a lot easier to setup. http://blog.alexellis.io/tag/swarmmode/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ubuntu-15-10-x64