2

Right now I have a slew of server entries defined like so:

server cn0136 10.33.125.17:8008 check
server cn0137 10.33.136.20:8008 check
server cn0138 10.33.124.23:8008 check
server cn0139 10.33.135.13:8008 check
server cn0140 10.33.137.23:8008 check
server cn0141 10.33.132.30:8008 check

All of these IPs are defined in DNS and I'd like for my server list to be updated automatically when DNS is updated. Ideally my server specification in the configs would simplify to something like:

servers cn_foo foo.bar.com:8000 check

Based on my reading of the docs and the answer to this ServerFault question it looks like this is not possible. Has anyone patched to handle this? Are there any other work arounds than using another templating system bolted on the side?

chicks
  • 3,639
  • 10
  • 26
  • 36

1 Answers1

2

If you use a newer version of haproxy, it will support it in a smart way. Just read chapter 5.3 of the documentation.

Florin Asăvoaie
  • 6,932
  • 22
  • 35
  • 1
    This is either incorrect, or the question has been misunderstood. HAProxy expects one `server` declaration to represent one target machine -- not a pool. The question is not just about runtime DNS updates, but about reconfiguring the backend proxy's list of member servers in response to DNS changes. – Michael - sqlbot Dec 30 '15 at 13:12
  • You are right, I misread the question. – Florin Asăvoaie Jan 02 '16 at 00:18