I am new to AWS EC2,
Objective: To create 3 instances of Ubuntu machines on EC2 and initialise Swarm on the first instance and add the other 2 instances as workers to the Swarm.
Error: Swarm initialization works fine but adding workers to the swarm throws an error
~$ docker swarm join --token SWMTKN-1-4yquvx0xihdhcv0m1vmxmbq4q45hoanm9ig00pue7opx3dhc1s-2ybrjxx97mpjyo351sx8jyisp 172.31.31.41:2377
Error response from daemon: Timeout was reached before node was joined. The attempt to join the swarm will continue in the background. Use the "docker info" command to see the current swarm status of your node.
~$ docker info
*****
Swarm: error
NodeID:
Error: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Is Manager: false
******
I have looked at the relevant questions on stackoverflow (Docker 1.12.1: after swarm init, workers unable to join swarm) but those solutions are not working in my case
How do I enable my other 2 instances to join the swarm