docker swarm


get public ip


create swarm (this host is now a manager)

docker swarm init --advertise-addr X.X.X.X

the command gives us the command to launch on the other hosts
we can also get this from this command :

docker swarm join-token worker
docker swarm join-token manager

now run the command to join the swarm on another host (this other host is now a worker)

docker swarm join --token xxxxxxxxxxxxx X.X.X.X:2377

remove tasks from a manager or reactivate it :

docker node update --availability drain
docker node update --availability active

show all hosts from manager

docker node ls

run this on every server to stop swarm :

docker swarm leave

remove a node from swarm from the manager

docker node rm fkvwjkdvyg4ymeeq0xak67j4w