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

I've got a web app that's split into two components. A WCF service hosted on port 4444 and a regular set of web services hosted on port 80 via IIS.

I've got my nodes set up in haproxy, but I now need to extend my configuration to ensure that my health checking for port 80 removes a node if port 4444 is down. This is because the code running on port 80 expects the service on to be there on localhost:4444 and will fail if 4444 is offline. If I configure haproxys health checks to check port 4444 for the port 80 group. It removes the port 80 node when the service on 4444 is not listening. But does not remove it if I stop IIS. Is there anyway to configure haproxy to check both ports and remove the server if one OR the other is failing?

Here is my config.

listen WEB80 10.1.1.100:80
mode http
balance roundrobin #round robin it yo
option httpclose
option forwardfor
server Web1 10.1.1.13:80 check port 4444
server Web1 10.1.1.14:80 check port 4444

listen AP4444 10.1.1.100:4444
mode http
balance roundrobin #round robin it yo
option httpclose
option forwardfor
server App1 10.1.1.13:4444 check
server App2 10.1.1.14:4444 check
share|improve this question

1 Answer 1

This is a very old question, but I have a suggestion for anyone else that might come across this.

Write a little php/cgi/whatever script which checks to see if port 4444 is open. Switch all checks to run on port 80 and use the script above as the check.

E.g.,

listen WEB80 10.1.1.100:80
mode http
balance roundrobin #round robin it yo
option httpclose
option forwardfor
option httpchk GET /check.cgi
server Web1 10.1.1.13:80 check port 80
server Web1 10.1.1.14:80 check port 80

listen AP4444 10.1.1.100:4444
mode http
balance roundrobin #round robin it yo
option httpclose
option forwardfor
option httpchk GET /check.cgi
server App1 10.1.1.13:4444 check port 80
server App2 10.1.1.14:4444 check port 80
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.