I’m pretty sure @Baptiste did read the other replies in the thread:
To be honest I just wasn’t sure if I was doing anything wrong as having multiple backends on the same hostname but different ports must be pretty common I thought?
Here’s some sanitized config of what I’m doing. Would be good to know if it’s incorrect in anyway.
This is expected behavior. HAProxy avoids reusing the same IP address.
What is your use case?
My use case is having several backends on the same IP but a different port. Is that atypical?
Do you mean several server in the same backend but on different port?
Are you delivering the same application on each port?
That’s my understanding of this use-case, yes.
Please see the previous thread:
I believe we should consider “IP:port” unique, not only “IP”.
Yes to both Several servers of the same application running on one box on different ports for a HA setup.
We are using same method
Example Application-Port configuration
HAProxy 1.8 SRV record gives 3 servers but it should 4 servers
I think I understand the problem.
We introduced a duplicate IP detection in HAProxy 1.8. The main purpose was to prevent people provisioning 20 servers in HAProxy that would have the same hostname and all of them would be enabled by default.
The main issue I see currently is that each server runs its own resolution, atomically.
I see a few ways to workaround this problem, but I need to study the different options and their impact.
Awesome. Many Thanks @Baptiste. What’s the best way to follow this and get updates?
Please find 4 patches attached to this email.
Could you please apply them and tell me if the new behavior is as expected?
(you must enable the new flag resolve-accept-dup-ip on the server line).
Well, download latest code from git, put the patches in the same directory and do a “git am *.patch”, then compile as usual.
I just typically install from the IUS repo. What would be the best way to get the patches in?
Could you send me these patches?
If you are on the ML, you can find them there: https://firstname.lastname@example.org/msg30461.html
If not, please send me your mail address.
(just in case, I tried to attach them here, hopefully this will work…)
Managed to get this working today with the latest checkout from github and can confirm that it works like a charm!
Great thanks for the feedback!
I’ll check with maintainers to integrate the patches in mainline.
I’m using server-template, this is my configuration
default-server init-addr none resolvers consul resolve-prefer ipv4 server-template server 4 _test._tcp.service.consul check resolve-accept-dup-ip
This could not worked. I think, you patched only server. Right?
Nope, I supposely patch everything, but I might have messed up.
Please note this is not the definitive patch and the option name will change.
I keep you updated asap with a new set of patches.
I double checked it and it works well, as expected with server, default-server and server-template.
Note that I’m going to push those patches on the ML this afternoon (europe time)