In this step we'll create a swarm cluster from two nodes. You should've received access to two nodes in AWS.
- SSH in to the first node:
ssh -i docker_demo.pem ubuntu@IP1
- Figure out the internal IP address of the node:
ifconfigand check the eth0 address (
- Initialize the Swarm cluster: `docker swarm init --listen-addr INTERNAL_IP --advertise-addr INTERNAL_IP
- Open a new tab and SSH to the other node:
ssh -i docker_demo.pem ubuntu@IP2
- Check the internal IP of that node:
- Join to the cluster with the command the previous command printed out. Before executing the command, you need to the extend it with the
--advertise-addrparameters (using the internal IP of the second node):
docker swarm join TOKEN --listen-addr 10.0.... --advertise-addr 10.0..... node1...
- Get back to the first node and verify the results:
docker node ls