- [Instructor] Docker Swarm is the cluster management
and orchestration feature that's built
into the Docker Engine.
Docker Swarm is available whether or not
you have Docker Community Edition or Enterprise Edition,
and it's available on all platforms.
Just so you have an understanding
of what a Docker Swarm cluster is,
we've got a diagram here that shows what would happen
if we had a failure in our Docker Swarm cluster.
Here we have three different worker nodes,
and it's the worker nodes that actually run
the containerized applications.
The Swarm manager nodes that aren't shown in this diagram
are there to insure that the high availability,
orchestration, and the Universal Control Plane
are always available.
Let's pretend that we had a failure
on a single worker node in the Docker Swarm cluster.
The applications that are containerized
and running on that worker node would be restarted
on the other worker nodes in the Docker Swarm cluster.
Let's say that you had a web application
and you said you wanted to always have 100 replicas
or 100 web servers in containers running at all times.
It's the Docker Swarm high availability feature
that would insure that those web servers are always running
even if the unexpected happens in the data center
and you lose a physical server and a worker node goes down.
If you'd like to learn more
about Docker Swarm clustering in detail,
I encourage you to check out a separate course
that I've created in this learning path
dedicated to Docker orchestration,
specifically Docker Swarm.
At this point, let's assume that we've installed
the Docker Engine, specifically Docker Enterprise Edition,
on our Docker node.
We've installed the Universal Control Plane,
and what we want to do now is to add a worker node.
You should note, by installing the Universal Control Plane
a Docker Swarm cluster was first initialized,
and we have a single manager node already running
with the Docker Universal Control Plane.
Let's go over to UCP and I'll show you
how to join a new worker node to the Docker cluster.
Here we are in UCP.
To add a new node to the Docker cluster,
we're going to go into Nodes,
and then click on the button here that says Add Node.
Before we do that, you can see we do have the single node
already added, and its role is a manager.
Let's go into Add Node,
and we're going to be adding a worker node,
it is a Linux type node, and to add the node,
we're simply going to copy the command string here
that's already provided.
You should note that the command is docker swarm join
and we have the token that's being provided
for our Swarm cluster along with the IP address
of the Docker manager that's already existing
in the Swarm cluster.
Just to give you an idea of how we're running
this Docker Swarm cluster on our local machine,
we're using VMware Fusion
and we've created three different virtual machines
that represent the three different nodes
that are going to make up this Docker cluster.
The first node that's already running,
which is here called DC2-N1, so Docker cluster 2, node 1,
that's where we've installed the Docker Engine,
we've installed UCP,
and that's our manager for the Docker Swarm cluster.
We're about to add DC2-N2, or node 2,
as the second node in our Docker cluster,
and this is going to be a worker node.
Just a reminder, you wouldn't be doing it this way
in production, this is to simulate the Docker Swarm cluster
for our lab and learning environment.
I have the docker swarm join command in our copy buffer.
Let's go in and paste it in that node to join the cluster.
I'll press Enter, and there we go,
it says, This node joined a swarm as a worker.
Let's go back into UCP.
We'll close this out, and there we go,
we just added a new worker node, our first worker node,
to our Docker Swarm cluster.
We can use this worker node now
to run our containerized applications
or to install other services,
for example, the Docker Trusted Registry.