Setting-Up Docker Swarm Cluster
Configuring A Swarm Manager
- Install Docker on Ubuntu 18.04
- Be sure to use the private IP (NOT the public IP) for the
--advertise-addr
:docker swarm init --advertise-addr <swarm manager private IP>
- This shows some basic information about the current status of the swarm:
docker info
- List the current nodes in the swarm and their status:
docker node ls
Configuring Swarm Nodes
- Install Docker on Ubuntu 18.04
- Get a join token from the manager. Run this command on the swarm manager:
docker swarm join-token worker
- Now copy the
docker swarm join
command provided in the output and run it on both workers:docker swarm join --token <token> <swarm manager private IP>:2377
- On the swarm manager, verify that the two worker nodes have successfully joined:
docker node ls
Tag:Docker, Docker Swarm