Docker Community Forums

Share and learn in the Docker community.

Service discovery in Swarm (>1.12)

With previous docker versions of Docker in order to create a swarm you needed some sort of service discovery backend (i used Consul). I used registrator and consul-template to automatically update my load balancer. In docker 1.12 this seems to no longer be required. This is a concern for me in two ways. First of all i have no way for my loadbalancer to be dynamically updated as i add nodes or add services. Secondly i am worried about keeping the state of my whole cluster in memory. In case something goes very wrong, how do i recover?
So my question is: Is there a way to have Docker swarm in 1.12 use a different service discovery backend?

1 Like

Automatic load balancing is supported.

Refer

Hi. The build in load balancing is useless for external clients. They require one single IP to connect to. I could just choose one at random but then this node would be a single point of failure.

Yes this is exactly the issue I’m having (plus the fact that asking clients to connect to port 3000x isn’t great…), I’m going to look into writing a tool which can be run as a global service and will expose services via hostnames on the correct ports based on labels. This way a floating IP address across swarm nodes would fix the single point of failure issue.

I was having this issue: docker-flow-proxy found to be good. It’s based on HAProxy and swarm listener node. https://github.com/vfarcic/docker-flow-proxy

Was able to set it with ease.

regards
Achuth