overexchange
overexchange

Reputation: 1

Ports to open for docker swarm(cluster)

Created 6 EC2 instances in Central region.

Below security group(only) is applied for each EC2 instance:

enter image description here

enter image description here

Out of 6 nodes, 3 managers & 3 worker nodes, in docker swarm


docker version 19.03.1

EC2 instance(mgr1) is successfully included in swarm(cluster) using command:

 docker swarm init --advertise-addr 172.31.4.156:2377 --listen-addr 172.31.4.156:2377

On mgr2, after running below command:

ubuntu@mgr2:~$ docker swarm join --token SWMTKN-1-2emfdddddddddddddddddue2y75runbithrtcadjakh8ttgt 172.31.4.156:2377 --advertise-addr 172.31.27.84:2377 --listen-addr 172.31.27.84:2377

gives below error:

Error response from daemon: Timeout was reached before node 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.
ubuntu@mgr2:~$ 

On checking the cluster status on mgr2, below is the ouput:

ubuntu@mgr2:~$ docker node ls

gives

Error response from daemon: This node is not a swarm manager.Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.

1) What port numbers should be open for all 6 EC2 nodes? inbound & outbound

2) Is communication TCP based? for working of docker swarm...

Upvotes: 0

Views: 3091

Answers (1)

masseyb
masseyb

Reputation: 4132

The TCP and UDP ports that need to be opened for docker swarm is documented here.

Upvotes: 1

Related Questions