3 Docker Engines - Number of Managers in Swarm

Hello, hive mind,

I have 3 Docker Engines.
I have a Docker Swarm with all 3 nodes involved.
Originally I had 1 manager and 2 workers. But I had shut the instance on the node 1 (manager) then there is no leader governing the workers.

Is it RP to have all 3 nodes promoted? Thus node 1 is the leader and node 2 and 3 are reachable and if node 1 goes then node 2 is the leader and so on…

I am learning Docker and the orchestration model and what is a good practice and what is not.

Thanks,

With 3 nodes, I would aim for a manager only cluster. Docker uses the Raft consensus algorithm for quorum. To reach quorum you need to have floor(n/2)+1 nodes to be healthy.

1 master node can compensate no loss → cluster will be headless,
2 master nodes can compensate no loss → either one node unaivalable renders the cluster headless.
3 master nodes can compensate the loss of 1 master node, will be headless if 2 or more fail.
5 master nodes can compensate the loss of 2 master nodes, will be headless if 3 or more fail.
7 master nodes can compensate the loss of 3 master nodes, will be headless if 4 or more fail.
Due to how Raft works, it is not recommended to have more than 7 master nodes.

if a cluster is headless, running containers remain running, but you won’t be able to change state for objects within the cluster (container, networks, volumes,…).

Make sure the nodes are connected in a network with low latency (none of the nodes should be on a remote site!)