Skip to content

Create a 2 node swarm

Course: Docker Swarm - chapter 4

  • Create two EC2 machines, install docker in both of them
  • Initialise swarm in the first machine
docker swarm init
  • Make the other server join the master (replace the token, ip from the first command)
docker swarm join --token b-1-45q02kic0tij84lhkb5du9esm38ly2g6kf3ssm2tq1l6uhwp2s-1i8892561cmfyntnatx97ub1b 192.168.65.3:2377
  • Make sure the 2377 port on the machine is open
  • Confirm the nodes status
docker node ls