Docker Community Forums

Share and learn in the Docker community.

Cannot link service with 'every_node' deployment strategy


(Allan Sun) #1

We have been using DockerCloud/HAProxy for quite a long while and it’s been running fine, ( apart from the other well known DockerCloud DNS issues occasionally…).

Today I wanted to try to change our App service’s deployment strategy from existing ‘emptiest_node’ to ‘every_node’. Because with ‘emptiest_node’ strategy, containers may be all re-deployed to a newly created ‘node’ and that’s not what we want.

Change the deployment strategy doesn’t seem like an issue, I have to kill the old stack and ‘re-deploy’ a new stack, because the ‘every_node’ mode cannot be changed from or to. That’s fine, so far so good, however when I link our ‘app service’ to ‘haproxy service’ the API responded correctly, but haproxy cannot see linked services (no configuration loaded even though I can ping the app service from haproxy). I checked the ‘HAProxy service’ from the web, I can see the expected link alias shown there but the actual service is not. When I go to the Nginx service and can see it linked from HAProxy…

You see even though the "Nginx-master-xxx-master’ alias is shown there after linking the service, there’s no actual service linked!

My ‘app service’ is something like this

Nginx:
environment:
- 'VIRTUAL_HOST=www.xxx.com
expose:
- '80’
image: 'our-own-namespace/docker-service-nginx:master’
restart: always
roles:
- global
deployment_strategy:every_node

Any ideas why I cannot link a service with ‘every_node’ mode? When I switch back to ‘emptiest_node’ everything’s working again.


(Imjosh2) #2

I don’t quite understand what it’s saying but I’m guessing it has to do w/ this:

“If an EVERY_NODE “client” service is linked to a “server” service that is also using the EVERY_NODE strategy, containers will be linked one-to-one on each node. The “client” services will not be automatically linked to “server” services on other nodes.”

I’m not an expert but it seems like the high availability strategy would end up doing what you want:

“A service using the HIGH_AVAILABILITY strategy deploys its containers to the node that matches its deploy tags with the fewest containers of that service at the time of each container’s deployment. This means that the containers will be spread across all nodes that match the deploy tags for the service.”


(Allan Sun) #3

Thanks very much for your help, you are absolutely right about that!

Obviously I overlooked the bit of ‘every_node’ to ‘every_node’. Our HAProxy is deployed in ‘every_node’ mode, I will change our ‘app’ service to ‘HIGH_AVAILABILITY’, and that should work as expected.