Score:0

Can't use external-check in Haproxy

cv flag

I'm trying to use the option external-check in haproxy, but after service restart in log I see:

Dec 30 10:41:34 1 haproxy[89540]: [WARNING]  (89540) : config : 'external-check command' will be ignored for proxy 'primary' (requires 'option external-check').
Dec 30 10:41:34 1 haproxy[89540]: [WARNING]  (89540) : config : 'external-check path' will be ignored for proxy 'primary' (requires 'option external-check').

content of haproxy.cfg:

global
     log 127.0.0.1   local2
     log /dev/log    local0
     log /dev/log    local1 notice
     chroot /var/lib/haproxy
     stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
     stats timeout 30s
     external-check
     user haproxy
     group haproxy
     maxconn 4000
     daemon

defaults
    mode                    tcp
    log                     global
    option                  tcplog
    retries                 3
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout check           10s
    maxconn                 3000

listen stats
    mode http
    bind *:7000
    stats enable
    stats uri /

listen primary
    bind 192.168.57.200:5000
    option external-check
    external-check path "/usr/bin:/bin"
    external-check command "/bin/ldapHealthCheck.sh"
    option httpchk OPTIONS /master
    http-check expect status 200
    default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions
    server patroni1 192.168.57.133:6432 maxconn 100 check port 8008
    server patroni2 192.168.57.134:6432 maxconn 100 check port 8008
    server patroni3 192.168.57.136:6432 maxconn 100 check port 8008

Why option external-check is still required when I have this parameter added in my configuration?

Score:0
th flag

i'm not sure if this is the Problem but your HAProxy is working in a chroot Jail (under global chroot /var/lib/haproxy). So if you want to get your external-check working, you need to add at least bash in your chroot. Check this thread: https://discourse.haproxy.org/t/external-check-and-chroot/2150/13 hope this may helps you :D

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.