Swarms Flashcards
What is a swarm?
Docker Swarm is Docker’s native feature to support clustering of Docker machines. A swarm is made up of multiple nodes, which can be either physical or virtual machines.
What is a manager node?
The manager node performs cluster management and orchestration.
What is a worker node?
The worker nodes perform tasks allocated by the manager.
What strategies can swarm manager use?
Swarm managers can use several strategies to run containers, such as “emptiest node” – which fills the least utilized machines with containers. Or “global”, which ensures that each machine gets exactly one instance of the specified container. You instruct the swarm manager to use these strategies in the Compose file, just like the one you have already been using.
What happens when swarm mode is enabled?
Enabling swarm mode instantly makes the current machine a swarm manager. From then on, Docker will run the commands you execute on the swarm you’re managing, rather than just on the current machine.
How do you deploy your app to a cluster?
first copy yml file to home directory of swarm manager
& docker-machine scp docker-compose.yml myvm1:~
run the same deploy command on manager node
$ docker-machine ssh myvm1 “docker stack deploy -c docker-compose.yml getstartedlab”
How to make a machine swarm manager?
$ docker-machine ssh myvm1 “docker swarm init”
How to join to a docker swarm?
$ docker-machine ssh myvm2 “docker swarm join \
–token \
:”
How to open a terminal on VM?
docker-machine ssh myvm2