Set up docker swarm

Note:

  1. Docker has to be installed on the server

  2. Docker swarm technology is already implemented into the docker installation

To install docker follow this guide

  1. Enable docker swarm on master node

sudo docker swarm init --advertise-addr <master_node>

This will print on screen a docker command that has to be run on every worker node

2. Run command on worker nodes

sudo docker swarm join --token <TOKEN_STRING> <master_node>

3. Verify if the nodes have actually joined the cluster successfully

sudo docker info

Notes:

  • To go more in depth about the nodes:

sudo docker node ls
  • To get the token again, run the command on the master node:

sudo docker swarm join-token manager 

Last updated