on a swarm with 3 nodes, if i have a service with 1 replica, i can access to the service from all nodes ?
i tests it and didnt work
on doc. we have
"External components, such as cloud load balancers, can access the service on the PublishedPort of any node in the cluster whether or not the node is currently running the task for the service. All nodes in the swarm route ingress connections to a running task instance."
Can you please provide the command that you used to create the service. If you use ingress routing mesh, the service can be accessed from any node using the published port.
[root@docker01 ~]# docker service ps tomcat_PROD
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
5ip4lr89mb8f tomcat_PROD.5 docker01:5000/centos_java8_tomcat8.5.16:latest docker03 Running Running 21 hours ago
can u try ādocker node lsā and make sure that there is no issue on swarm side.
Also, another thing to try is to increase replica count to 3 and see what happens.
[root@docker01 ~]# docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
41lx21b0bis0z892sx6f0068c * docker01 Ready Active Leader
u7lpkf9i6uv53nbtw67fyp7qc docker02 Ready Active
ybaw4dlpatskatakj2m8913ln docker03 Ready Active
swarm output looks fine.
Even if you have replica count of 1, the service should be accessible from all nodes. I just thought of it to just debugā¦
This is latest Docker CE version running in Linux system?
Swarm uses L4 ipvs based load balancing. If you want L7 based load balancing, you can either use Docker EE or other load balancers like traefik/nginx/haproxy.
btw, how did you fix the issue you had earlier?