Is Docker Roy's discovery still relevant?

I am learning about docker swarm and am confused about the swarm detection option, I see many tutorials on the internet use this setting to create docker-machine containers, but when I go into the docker swarm doc documentation it says:

You are viewing documents for a legacy autonomous swarm. These topics describe a standalone Docker Swarm. In Docker 1.12 and up, Swarm mode is integrated with the Docker Engine. Most users should use the integrated Swarm mode.

So what are the use cases for discovery options? All tutorials use a docker machine to create a swarm, do I always need one or can I just install docker on the machines in my cluster, merge them into a swarm and use a regular one?

I've seen names like Docker Swarm

and Docker Swarm Mode

, is there a difference or just different ways to call the same function?

+3


source to share


1 answer


Q. Is opening Docker Swarm still relevant?

A: Not if you are using docker Swarm Mode

and overlay network

(see below)


Q. Is there a difference between Docker Swarm

and Docker Swarm Mode

?

A: Yes , TL; DR is Docker Swarm

deprecated and should not be used anymore, Docker Swarm Mode

(we should just say Swarm Mode

) is the recommended way of container clustering and reliability, load balancing, scaling and rolling service updates.


Docker Swarm

( official doc ):

  • - the old fashioned way (<1.12) clustered containers.
  • uses a dedicated container to create a clusterDocker Swarm

  • requires a discovery service like Consul to link to containers in the cluster

Swarm Mode

( official doc ):



  • is the new and recommended way (> = 1.12) of clustering containers on host nodes (called managers

    / workers

    )
  • built in Docker engine

    , you don't need an extra container
  • has a discovery service built in, if you use overlay network

    (DNS resolution is done on this network) you don't need an extra container

You can have a look at this SO thread in the same section .


Q. Do I always need docker-machine

to create a swarm?

A: No , it docker-machine

is a helper for creating virtual hosts in the cloud like amazon ec2, azure, digitalocean, google, openstack ... or your own virtual box network.

To create Swarm Mode

, you need:

  • a multi-node cluster with a docker engine installed on each host (called a node) (this makes it easier docker-machine

    )
  • run docker swarm init

    to switch to Swarm Mode

    on your first node manager
  • run docker swarm join

    on worker nodes to add them to the cluster

There are several tweaks Swarm Mode

to improve high availability ( recommended number of managers per swarm , hosting node in multiple AZs in the cloud)

Hope this helps!

+4


source







All Articles