Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajeetraina/484f506e26d689b48b4dbef1f06943c3 to your computer and use it in GitHub Desktop.
Save ajeetraina/484f506e26d689b48b4dbef1f06943c3 to your computer and use it in GitHub Desktop.
docker-swarm-before-11.2-rc2
Docker Swarm before 1.12rc2:
1. Setting up Consul for Docker Swarm
sudo docker run --restart=unless-stopped -d -p 8500:8500 -h consul1 progrium/consul -server -bootstrap
2. Setting up Swarm Manager to work with Consul
docker run -d -p 4000:4000 swarm manage -H :4000 --replication --advertise 10.142.0.2:4000 consul://10.142.0.2:8500
3. Setting up secondary Swarm Master-2:
docker run -d -p 4000:4000 swarm manage -H :4000 --replication --advertise 10.142.0.5:4000 consul://10.142.0.2:8500
4. Setting up First Swarm Agent (Node-1):
root@node1:~# docker run -d swarm join --advertise=10.142.0.3:2375 consul://10.142.0.2:8500
5. Setting up Second Swarm Agent (Node-2)
docker run -d swarm join --advertise=10.142.0.4:2375 consul://10.142.0.2:8500
6. Let's check the cluster status running it on first master node:
docker -H :4000 info
To check the process,
5. You can check the process running:
docker -H :4000 ps
6. You can schedule a container from anyone of them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment