Skip to content

Instantly share code, notes, and snippets.

@aorjoa
Last active March 22, 2016 02:06
Show Gist options
  • Save aorjoa/f6a2e20e6df0baafbff8 to your computer and use it in GitHub Desktop.
Save aorjoa/f6a2e20e6df0baafbff8 to your computer and use it in GitHub Desktop.
How to form Swarm Cluster inside Arm cluster-+

Get Docker-1.9.1

go to https://github.com/Aorjoa/docker-arm then run make command for compile docker 1.9.1

Install Docker Machine to provision node

from here https://github.com/Aorjoa/Machine-Aiyara

run ./script/build to compile these source.

create machine

$ ./docker-machine_linux-amd64 -D create -d aiyara --aiyara-host-range=192.168.5.201 node

run docker container for consul discovery service.

$ docker $(/home/pk007server/src/github.com/docker/machine/docker-machine_linux-amd64 config rack-5-node-201) run -d -p 8400:8400 -p 8500:8500 -p 8600:53/udp -h "consul" aiyara/consul agent --data-dir /tmp -server -bootstrap 1 or $ docker $(/home/pk007server/src/github.com/docker/machine/docker-machine_linux-amd64 config rack-5-node-201) run -d -p 8400:8400 -p 8500:8500 -p 8600:53/udp --net=host aiyara/consul:0.5.2 agent -data-dir /data -server -bootstrap-expect 1

***** Note that ***** If you can used only in locally mode try to set client to ip address. docker run -d -p 8500:8500 --net=host aiyara/consul agent -server -data-dir /data -bootstrap-expect 1 -client=0.0.0.0

to create Swam master

$ ./docker-machine_linux-amd64 -D create -d aiyara --aiyara-host-range=192.168.5.201 --swarm --swarm-master --swarm-discovery "consul://$(/home/pk007server/src/github.com/docker/machine/docker-machine_linux-amd64 ip rack-5-node-201):8500" node

to provision and join cluster

$ ./docker-machine_linux-amd64 -D create -d aiyara --aiyara-host-range=192.168.5.202 --swarm --swarm-discovery "consul://$(/home/pk007server/src/github.com/docker/machine/docker-machine_linux-amd64 ip rack-5-node-201):8500" node

connect to Swarm master

eval $(docker-machine env --swarm rack-5-node-201)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment