Creating and managing a Swarm
Let's now take a look at using Swarm and how we can perform the following tasks:
- Creating a cluster
- Joining workers
- Listing nodes
- Managing a cluster
Creating the cluster hosts
Let's start by creating a cluster of three machines. Since we are going to be creating a multi-node cluster on our local machine, we are going to use Multipass, which we covered in Chapter 6, Docker Machine, Vagrant, and Multipass, to launch the hosts by running the following commands:
$ multipass launch -n node1 $ multipass launch -n node2 $ multipass launch -n node3
This should give us three nodes; you can check this by just running the following command:
$ multipass list
You should see something similar to the following output:
You may remember from when we last used Multipass that bringing up a host doesn't mean that Docker is installed...