I am trying to implement HAProxy for auto-failover for several ports. Like to have the capability to auto-failover all ports, such as 389, 443, and 8443 if any one of these ports is down.

Looks to me the following configuration only auto-failover on a port not all ports.

mode tcp
server s1 check inter 1s fail 3 rise 3
server s2 check backup


  • Don't use check backup but instead simply backup, this way you have more availability. And welcome the site! :) – kubanczyk Feb 19 at 20:04

Write a simple script that for a given server checks all three ports and which will return a non-zero error condition when either one or more port/service fails.

Configure and use that script as an external-check command </path/to/scriptname> for all your services instead of the native checks.

  • Thank you! I will take a look at it. Appreciated. – YMZ Feb 19 at 15:58
  • I tried external-check. Somehow, I can't make it work. Here is the message I got when I check the script. Looks like I have some chroot issue? ubuntu@ip-10-205-233-157:/etc/haproxy$ haproxy -f /etc/haproxy/haproxy.cfg -c [ALERT] 050/161903 (21641) : Proxy 'esa_ldap' : 'option external-check' unable to find required 'global.external-check'. [ALERT] 050/161903 (21641) : Fatal errors found in configuration. – YMZ Feb 20 at 16:21
  • Have you tried using an absolute path to the script global.external-check? – HBruijn Feb 21 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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