In
Read more here:
- https://docs.docker.com/engine/swarm/manage-nodes/#update-a-node
The great thing about this labeling is in docker compose file that you can tell docker which server should get deployed on which server (node):
#docker #node #swarm #label #role
docker
swarm mode you can list nodes with docker node ls
. If you want to assign a label to each node you can use the below command to update node labels. For example you can assign a key=value
pair like role=storage
to one of your node listed with the first command:docker node update --label-add role=storage YOUR_HOSTNAME
Read more here:
- https://docs.docker.com/engine/swarm/manage-nodes/#update-a-node
The great thing about this labeling is in docker compose file that you can tell docker which server should get deployed on which server (node):
deploy:
replicas: 4
placement:
constraints:
- node.labels.role == storage
NOTE:
role
is something that we ourselves have been defined. You can define your own as requirements vary.#docker #node #swarm #label #role
Docker Documentation
Manage nodes in a swarm
Manage existing nodes in a swarm