Docker Swarm is an orchestration tool provided with Docker. With Docker Swarm you can manage, scale, and maintain containerized applications.
A Docker swarm contains multiple Docker hosts which run in swarm mode and can act as both managers as well as workers. Managers manage swarm memberships and workers run swarm services.
Nodes in Swarm are Docker instances running in swarm mode. There are two kinds of nodes - Manager nodes and Worker nodes.
Manager nodes are responsible for orchestration and cluster management functions, which helps maintain the desired state of the swarm. Manager nodes also dispatch units of work or tasks to worker nodes.
Worker nodes execute tasks that are dispatched to them by Manager nodes, and update the status back to the Manager node.
You can use the Docker Swarm command docker service update
with the parameter --replicas
to specify the number of containers to run for a service.
For example below command creates 3 containers for the service myService
> docker service update myService --replicas 3