Linux/Docker/Swarm

From Wiki

Create swarm

  • on manager
docker swarm init --advertise-addr <MANAGER-IP>

-> copy command from here to join from nodes. e.g.:
docker swarm join --token SWMTKN-1-5fs8k04yvhalpcok7xa8ktryuin55w4gt1wf1aaj9vawwh52hx-1uk9i6yz3q7j7bzuqdun2xqwy 192.168.1.226:2377
  • show token
docker swarm join-token manager

Stats / Info

docker node ls

docker service ls

Manage nodes

from manager:
docker node promote node1
docker node demote node1
docker node rm node1
docker node inspect node1
docker node update --role manager node1

from node:
docker swarm leave