Linux/Docker/Swarm: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 4: | Line 4: | ||
docker swarm init --advertise-addr <MANAGER-IP> | docker swarm init --advertise-addr <MANAGER-IP> | ||
-> copy command from here to join from nodes | -> copy command from here to join from nodes. e.g.: | ||
docker swarm join --token SWMTKN-1-5fs8k04yvhalpcok7xa8ktryuin55w4gt1wf1aaj9vawwh52hx-1uk9i6yz3q7j7bzuqdun2xqwy 192.168.1.226:2377 | |||
</pre> | </pre> | ||
* show token | |||
<pre> | |||
docker swarm join-token manager | |||
</pre> | |||
== Stats / Info == | |||
<pre> | |||
docker node ls | |||
</pre> | |||
== Manage nodes == | |||
<pre> | |||
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 | |||
</pre> | |||
[[Category:Linux/Docker]] | [[Category:Linux/Docker]] | ||
[[Category:Linux]] | [[Category:Linux]] |
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
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