Docker Swarm is a clustering tool for Docker containers. It allows you to establish and manage a cluster of Docker nodes as a single virtual system. This means we get to run Docker on multiple hosts on our computers.
We control the swarm cluster through a manager which primarily handles and controls containers. With the swarm manager, you can create a primary manager instance and multiple replica instances in case the primary fails. This means you can have more than one manager in a swarm!
Note
A swarm is created from a manager node, and other Docker machines join the cluster, either as worker nodes or manager nodes.
Clustering is important because it creates a group of cooperating systems that provide redundancy, creating a fault-tolerant environment. For example, if one or more of the nodes goes down, Docker Swarm will fail over to another working node.
The Swarm manager carries out the following roles:
Accepts
docker
commandsExecutes commands against the cluster...