Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am a newbie to haproxy and was wondering if someone can confirm that the following config is valid? Effectively I would like to load balanced two servers on multiple ports.

<snippet>
Listen mybackendLB
  bind 10.6.200.14:555,10.6.200.14:8009,10.6.200.14:443
  mode tcp
  balance roundrobin
  option httpchk "/test.html"
  server app1 192.168.0.20:555 check port 8008
  server app1 192.168.0.20:8009 check port 8008
  server app1 192.168.0.20:443 check port 8008
  server app2 192.168.0.21:555 check port 8008
  server app2 192.168.0.21:8009 check port 8008
  server app2 192.168.0.21:443 check port 8008
<snippet>

In any case would this be a better option?

<snippet>
Listen mybackendLB
  bind 10.6.200.14:555,10.6.200.14:8009,10.6.200.14:443
  mode tcp
  balance roundrobin
  option httpchk "/test.html"
  server app1 192.168.0.20 check port 8008
  server app2 192.168.0.21 check port 8008
<snippet>
share|improve this question
    
The best way to ensure that the traffic goes to the same port is to split the listener individually. In above example, I need to create separate listeners for each port with 2 servers underneath. there will be a total of 3 separate listen entries. –  user169323 Apr 13 '13 at 8:47
    
Hi, old question, but is this still an issue? –  Felix Frank Aug 25 '14 at 14:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.