Linux/Docker/Swarm: Difference between revisions

From Wiki
< Linux‎ | Docker
mNo edit summary
Line 16: Line 16:
<pre>
<pre>
docker node ls
docker node ls
docker service ls
</pre>
</pre>


== Manage nodes ==
== Manage nodes ==

Revision as of 19:02, 5 December 2021

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