Skip to content

Instantly share code, notes, and snippets.

@mustafaakin
Created October 28, 2016 22:03
Show Gist options
  • Save mustafaakin/6f1c3fb7e079a646ca6c2626e572890c to your computer and use it in GitHub Desktop.
Save mustafaakin/6f1c3fb7e079a646ca6c2626e572890c to your computer and use it in GitHub Desktop.
// replace it with your own token
TOKEN=aaa12a00f2f264727a4c5436c070d58477cd6d5f13a0379955901c4a962e9ee2
# Create Key Store Node
docker-machine create --driver digitalocean \
--digitalocean-access-token=$TOKEN \
--digitalocean-region=ams3 mh-keystore-do
docker $(docker-machine config mh-keystore-do) run -d \
-p "8500:8500" \
-h "consul" \
progrium/consul -server -bootstrap
# Create Primary Node
docker-machine create \
--driver digitalocean \
--digitalocean-access-token=$TOKEN \
--digitalocean-region=ams3 \
--digitalocean-image=debian-8-x64 \
--swarm --swarm-master \
--swarm-discovery="consul://$(docker-machine ip mh-keystore-do):8500" \
--engine-opt="cluster-store=consul://$(docker-machine ip mh-keystore-do):8500" \
--engine-opt="cluster-advertise=eth0:2376" \
mhs-demo0-do
# Create Secondary Node
docker-machine create \
--driver digitalocean \
--digitalocean-access-token=$TOKEN \
--digitalocean-region=ams3 \
--digitalocean-image=debian-8-x64 \
--swarm \
--swarm-discovery="consul://$(docker-machine ip mh-keystore-do):8500" \
--engine-opt="cluster-store=consul://$(docker-machine ip mh-keystore-do):8500" \
--engine-opt="cluster-advertise=eth0:2376" \
mhs-demo1-do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment