SrigandanS
SrigandanS

Reputation: 55

Do I need to install docker in all my nodes inside the swarm mode?

I know this is a basic question. But I'm new to docker and have this query. Do I need to install docker in all my nodes that are part of my swarm mode?. If so what are the ways that I install docker in all my nodes in one shot?

Upvotes: 1

Views: 253

Answers (1)

Metin
Metin

Reputation: 741

Of course you need to install Docker and its dependencies on each node. On one of the manager nodes, you need to initiate the swarm with docker swarm init and then you join the other machines either as manager nodes or worker nodes.

The number of manager nodes depends on your requirement to compensate node losses:

  • 1 manager node: requires 1 healthy node
  • 3 manager nodes: require 2 healthy nodes for quorum, can compensate 1 unhealthy node
  • 5 manager nodes: require 3 healthy nodes for quorum, can compensate 2 unhealthy nodes
  • 7 manager nodes: require 4 healthy nodes for quorum, can compensate 3 unhealthy nodes
  • more than 7 is not recommended due to overhead

Using a even number does not provide more reliability, it is quite the oposite. If you have 2 manager nodes, the loss of either one of them renders the cluster headless. If the cluster is not able to build quorum (requires the majority of of manager nodes beeing healthy), the cluster is headless and can not be controlled. Running containers continue to run, but no new containers can be deployed, failed containers won't redeploy, ...).

People usualy deploy a swarm configuration with a configuration management tool like Ansible, Puppet, Chef or Salt.

Upvotes: 1

Related Questions