One of the nifty features of the original "Docker Swarm" was that it:
turns a pool of Docker hosts into a single, virtual Docker host
allowing tools (such as the docker
CLI, and docker-compose
) to be agnostic about whether they were operating against a single instance of Docker Engine, or a Swarm cluster.
Docker 1.12 brings an integrated "swarm mode", which is an exciting new take on Docker orchestration. But, have we lost the "cluster as virtual Docker host" feature in the process? Using docker run
against a swarm-mode master only ever seems to start containers on the master node itself. docker ps
now returns no hint of which machine each container is running on. It it true that one must now use cluster-specific subcommands like docker service
and docker deploy
to do things across the cluster?
A swarm consists of multiple Docker hosts which run in swarm mode and act as managers (to manage membership and delegation) and workers (which run swarm services). A given Docker host can be a manager, a worker, or perform both roles.
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.
Docker Engine 1.12 introduces swarm mode that enables you to create a cluster of one or more Docker Engines called a swarm. A swarm consists of one or more nodes: physical or virtual machines running Docker Engine 1.12 or later in swarm mode. There are two types of nodes: managers and workers.
Features of Docker SwarmHigh security: Any communication between the manager and client nodes within the Swarm is highly secure. Autoload balancing: There is autoload balancing within your environment, and you can script that into how you write out and structure the Swarm environment.
Docker Swarm is not being deprecated, and is still a viable method for Docker multi-host orchestration, but Docker Swarm Mode (which uses the Swarmkit libraries under the hood) is the recommended way to begin a new Docker project where orchestration over multiple hosts is required.
Docker Compose is used for configuring and starting multiple Docker containers on the same host–so you don't have to start each container separately. Docker swarm is a container orchestration tool that allows you to run and connect containers on multiple hosts.
That's a correct interpretation. You will longer manage a Swarm as you have done with a single engine, the commands to manage and schedule in the Swarm are changing. Using docker run
and docker-compose
will target a single host. Using docker service
is needed to schedule on the swarm. The compose is moving to bundles that you docker deploy
and manage with docker stack
. I'd say one huge plus of the new design is not forgetting when you're managing the swarm vs a single node because you didn't check your setting of $DOCKER_HOST
.
Migration has been considered with docker-compose bundle
, and there's nothing preventing you from running the old swarm container implementation on the 1.12 platform and accessing it as you always have. You just won't get the orchestration benefits of the 1.12 Swarm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With