Load balancer works on CE version?

how it works on CE version ?

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 :frowning:

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.

docker service create --name orlando_PROD --replicas=1 docker01:5000/orlando/app2

You need to publish the service using -p : in “docker service create”

yes sorry, i used
docker service create -p 8076:8076 --name orlando_PROD --replicas=1 docker01:5000/orlando/app2

and didnt work, what i’m missing ?

The command looks fine.
Is the service accessible from some nodes?
Can try paste the output of “docker service ps orlando_PROD”

its only accessible on the node is running, on the other 2 nodes isnt accessible :frowning:

q01rrizc819g tomcat_PROD replicated 1/1 docker01:5000/centos_java8_tomcat8.5.16:latest *:8030->8030/t cp

[root@docker01 ~]# docker service ps tomcat_PROD
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.

i have manager - worker - worker

do i need to the 3 by managers ?

[root@docker01 ~]# docker node ls
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?

docker-ce.x86_64 17.06.0.ce-1.el7.centos


made a 3 mangers swarm, and now load balancing is working good.

but i need layer 7 , swarm is layer 4 right ?

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?

i had ( manager - worker - worker ) LB didn’t work or had strange behaviour
now i have ( mamager - manager - manger ) and LB works

i’m working with haproxy

docker service create --name nginx-80-host --network my-s -p target=80,published=80,mode=host --mount type=bind,source=/mnt/html,target=/var/www/html --replicas=3 richarvey/nginx-php-fpm

with the option mode=host i can disable native LB on the service