Home:ALL Converter>how to connect docker swarm worker to swarm manager - AWS EC2

how to connect docker swarm worker to swarm manager - AWS EC2

Ask Time:2019-05-09T17:41:19         Author:Nabeel Shaikh

Json Formatter

I am unable to connect my docker worker to docker swam manager.

I have created multiple aws EC2 instances and have made one of them as a manager docker swarm init --listen-addr 0.0.0.0:2377 and trying to connect it via other EC2 instances docker swarm join 0.0.0.0:2377 as a worker, But it gives me an error.

 "Error response from daemon: Timeout was reached before node joined`. 
The attempt to join the swarm will continue in the background".

I need my docker swarm manager to list docker node ls all the nodes including manager and workers.

Author:Nabeel Shaikh,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/56056586/how-to-connect-docker-swarm-worker-to-swarm-manager-aws-ec2
Nabeel Shaikh :

To resolve this problem I needed to expose respective ports from both Docker Worker and Docker Manager instances.\n\nI discovered some information while resolving this question, \n\nTCP Port 2377 is a Default port used for communication so add custom tcp rule for port 2377 in security group of aws EC2.\n\nTCP port 2376 for secure Docker client communication. This port is required for Docker Machine to work. Docker Machine is used to orchestrate Docker hosts.\n\nTCP port 2377 This port is used for communication between the nodes of a Docker Swarm or cluster. It only needs to be opened on manager nodes.\n\nTCP and UDP port 7946 for communication among nodes (container network discovery).\n\nUDP port 4789 for overlay network traffic (container ingress networking).\n\nKindly Note: Aside from those ports, port 22 (for SSH traffic) and any other ports needed for specific services to run on the cluster have to be open.",
2019-07-25T10:33:42
Frank Louwers :

You need to use the real ip address in the docker swarm join command.\n\nThe \"0.0.0.0\" is not a real ip-address, it's an alias for \"all (local) ip-addresses\", it's not something you can connect to.",
2019-05-09T15:34:57
yy