Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between using Docker Machine with Swarm and using Swarm through the Docker daemon?

What exactly is the difference between having multiple docker machines in a swarm (a manager and many nodes) and having multiple replicas of a docker service in a swarm?

like image 778
Alexander George Avatar asked Jan 09 '17 16:01

Alexander George


People also ask

What are the two types of Docker swarm services?

Swarm mode has two types of services: replicated and global. For replicated services, you specify the number of replica tasks for the swarm manager to schedule onto available nodes.

What is difference between Docker and Docker Swarm?

A Docker Swarm is a group of either physical or virtual machines that are running the Docker application and that has been configured to join together in a cluster. Docker swarm is a container orchestration tool, meaning that it allows the user to manage multiple containers deployed across multiple host machines.

What is the main difference between Docker Docker swarm and Kubernatees k8's?

Docker Swarm – A comparison. Now that we have covered the advantages and challenges of Kubernetes and Docker Swarm, let's see how they differ from one another. The major difference between the platforms is based on complexity. Kubernetes is well suited for complex applications.

What is the Docker daemon?

The Docker daemon ( dockerd ) listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes. A daemon can also communicate with other daemons to manage Docker services.


1 Answers

Well, since nobody answered this, I carried on reading more on the Internet trying to understand what's the difference between this two concepts. This is what I understand so far:

  • A Docker Machine is a very small virtual machine that runs an instance of the Docker Engine. This means we can run Docker containers inside it. It can be understood as a container of containers.
  • The Docker Engine has (since the 1.12 version) a module called Swarm Mode, which offers built-in support for connecting and orchestrating many machines (physical or virtual -- like Docker Machines) containing the Docker Engine. This basically builds a network of nodes that are directed by a manager -- a central node. At this point, an instance of a service could be replicated, and the manager would spread the replicas over the nodes efficiently.
  • Alternatively, Docker Machines can run Swarm containers (based on the Swarm image), which can be set up to behave in a similar way as in the previous case. Again, we can have a Docker Machine behaving as a manager and many others behaving as nodes, only this time the manager will not balance replicas of a service, but whole containers. When launching a new container, the manager will distribute it to a certain node. This is the standalone version of Swarm, and is only recommended when using a version of Docker previous to 1.12 -- otherwise the Swarm Mode is a better option.

I hope this helps.

like image 63
Alexander George Avatar answered Sep 25 '22 06:09

Alexander George