I am new to Docker Swarm. I have 3 nodes added to swarm
:
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
5l5bh04q1lrhchq0mdr7t4w0k * ip-172-31-45-243.us-west-2.compute.internal Ready Active Leader
odf5tx9ynoqpvbsxfobs51cse ip-172-31-36-22.us-west-2.compute.internal Ready Active Reachable
t3qu3e7hyq2le50q35ycwqoos ip-172-31-45-19.us-west-2.compute.internal Ready Active Reachable
I created a service
using this command, swrm
is an overlay network
:
docker service create --name server --network swrm --publish 80:80 httpd
Issue: I am able to access http port 80
only from the swarm node where the service task is started and not from other nodes which are a part of the swarm. e.g. If the task is started in ip-172-31-45-243.us-west-2.compute.internal
, then I cannot access http port 80
from other nodes such as ip-172-31-36-22.us-west-2.compute.internal
.
Please let me know how can I access http port 80
from either of the swarm nodes irrespective of the node where task is created. Please help.