Docker swarm is a clustering of machines that are running docker applications. Docker Swarm is used to checking the running state of containers. It helps in maintaining the consistent number of containers in the running state.
Dockers Swarm uses distributed system architecture with leader node, manager nodes, and worker nodes. Leader node will be only one and in case of any failure, a new node will be made a leader node. The leader node is responsible for managing swarm. There can be up to seven manager nodes and they assign tasks to worker nodes. Multiple worker nodes can be there in a swarm and their main aim is to complete the tasks assigned by manager nodes.
I would suggest this Docker Training Course if you are interested to learn Docker swarm.
You can watch this video to learn Docker swarm and how to create Docker swarm: