I have 2 applications server (middleware) where the software listen on different socket for different channel, so the result is that i have 120 different port open from 10000 to 60000
I want to put an HAproxy on head of that, and i google for solution…
backend BKTEST
stick store-request src
stick-table type ip size 200k expire 120m
option persist
option redispatch
balance roundrobin
server as1 xxx.yyy.zzz.127 (no port means the same port right?)
server as2 xxx.yyy.zzz.128
where obv xxx.yyy.zzz.126 is my VIP, and xxx.yyy.zzz.127,128 are my as
is the correct solution?
what is the option like fowardfor for tcp balancing?
Your configuration might work, that said, I don’t think it’s a good idea to bind 50K ports when you need only 120…
Is there, by any chance, a port that will always be opened on the server side (for monitoring purpose) ?
About your forwardfor question for TCP, you may want to use proxy-protocol, but the application servers must be compatible with it.
More info about Proxy protocol: https://www.haproxy.com/blog/haproxy/proxy-protocol/
“tcp-check send/expect” is when you want to mimic an actual client and know exactly what the protocol has to look like.
I think its best to only check a specific port.
You can specify the health check port like this: server as2 xxx.yyy.zzz.128 check port 1050
It won’t change the behavior for actual traffic, only health checks now use port 1050. This will mark the server down when haproxy cannot connect to port 1050 on that particular server.