Topics

Missing Healthchecking child

vot4anto@...
 

Hi,
 I'm writing to notify some strange behaviour of keepalived on debian buster.
On the software_design.rst I can read the follow: 
 When running you will see in process list::
 
    PID         111     Keepalived  <-- Parent process monitoring children
                112     \_ Keepalived   <-- VRRP child
                113     \_ Keepalived   <-- Healthchecking child
 
This is the normal behaviout that I can see on Debian 9 and keepalived 1.3.x
But on debian buster in all the installation that I do , either from debian repository or from source (downloaded from github) I don't have the 3 PID.
 
The Healthchecking child is missing.
 
I download the follow versions that resolv this issue: https://github.com/acassen/keepalived/issues/1364
wget https://github.com/acassen/keepalived/tarball/18262c7 -O keepalived-v2.0.18-g18262c7.tar
 
I use this version at the last after the 2.0.10, 2.0.17 and 2.0.18 but I have always same behaviour
 
So, follow all the information on the debian and keepalived:
 
the version of keepalived is:
 
:/home/ansible/acassen-keepalived-18262c7/doc/source# /usr/sbin/sbin/keepalived -v
Keepalived v2.0.18 (unknown)
 
Copyright(C) 2001-2019 Alexandre Cassen, <acassen@...>
 
Built with kernel headers for Linux 4.19.67
Running on Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
 
configure options: --prefix=/usr/sbin/
 
Config options:  LIBIPTC LIBIPSET_DYNAMIC NFTABLES LVS VRRP VRRP_AUTH OLD_CHKSUM_COMPAT FIB_ROUTING
 
System options:  PIPE2 SIGNALFD INOTIFY_INIT1 VSYSLOG EPOLL_CREATE1 IPV4_DEVCONF IPV6_ADVANCED_API LIBNL3 RTA_ENCAP RTA_EXPIRES RTA_NEWDST RTA_PREF FRA_SUPPRESS_PREFIXLEN FRA_SUPPRESS_IFGROUP FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK RTEXT_FILTER_SKIP_STATS FRA_L3MDEV FRA_UID_RANGE RTAX_FASTOPEN_NO_COOKIE RTA_VIA FRA_OIFNAME FRA_PROTOCOL FRA_IP_PROTO FRA_SPORT_RANGE FRA_DPORT_RANGE RTA_TTL_PROPAGATE IFA_FLAGS IP_MULTICAST_ALL LWTUNNEL_ENCAP_MPLS LWTUNNEL_ENCAP_ILA LIBIPTC LIBIPSET_PRE_V7 NET_LINUX_IF_H_COLLISION LIBIPVS_NETLINK IPVS_DEST_ATTR_ADDR_FAMILY IPVS_SYNCD_ATTRIBUTES IPVS_64BIT_STATS VRRP_VMAC VRRP_IPVLAN IFLA_LINK_NETNSID CN_PROC SOCK_NONBLOCK SOCK_CLOEXEC O_PATH GLOB_BRACE INET6_ADDR_GEN_MODE VRF SO_MARK SCHED_RT SCHED_RESET_ON_FORK
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
 
uname -a
Linux gideblbtest1 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
 
cat /etc/keepalived/keepalived.conf
global_defs {
  router_id lbtest1 # 100
  enable_script_security
}
 
 
vrrp_script chk_haproxy {
        script "/usr/bin/pgrep haproxy"
        interval 1
#       weight 2
}
 
vrrp_instance lbtest {
       
        interface ens192
 
        state BACKUP
 
        garp_master_delay 1
        advert_int 2
 
        virtual_router_id 216
        priority 100    # 99 on master, 98 on backup
 
        authentication {
                auth_type PASS
                auth_pass eI6Kk5
        }
 
        virtual_ipaddress {
           192.168.0.216/24 dev ens192 label ens192:VRRP_IP
        }
 
        track_script {
            chk_haproxy
        }
        notify /usr/local/bin/keepalivednotify.sh keepalived_script
}

 
cat /usr/local/bin/keepalivednotify.sh
#!/bin/bash
GROUP= $1
NAME=$2
STATE=$3
 
case $STATE in
        "MASTER") /bin/echo 1 > /tmp/keepalived.state
                  exit 0
                  ;;
        "BACKUP") /bin/echo 0 > /tmp/keepalived.state
                  exit 0
                  ;;
        "FAULT")  /bin/echo -1 > /tmp/keepalived.state
                  exit 0
                  ;;
        *)        /bin/echo -2 > /tmp/keepalived.state
                  exit 0
                  ;;
esac
 
This is the log of startup:
 
Oct 16 10:54:54 gideblbtest1 Keepalived[16726]: Starting Keepalived v2.0.18 (unknown)
Oct 16 10:54:54 gideblbtest1 Keepalived[16726]: WARNING - keepalived was build for newer Linux 4.19.67, running on Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
Oct 16 10:54:54 gideblbtest1 Keepalived[16726]: Command line: '/usr/sbin/sbin/keepalived' '-D'
Oct 16 10:54:54 gideblbtest1 Keepalived[16726]: Opening file '/etc/keepalived/keepalived.conf'.
Oct 16 10:54:54 gideblbtest1 Keepalived[16727]: Starting VRRP child process, pid=16728
 
#ps -eaf | grep keep
root      16727      1  0 10:54 ?        00:00:00 /usr/sbin/sbin/keepalived -D
root      16728  16727  0 10:54 ?        00:00:04 /usr/sbin/sbin/keepalived -D
I can't see the third pid 🙁
 
 
Please let me to know,
Best Regards,
Antonio
 

Quentin Armitage
 

On Wed, 2019-10-16 at 23:59 -0700, vot4anto@... wrote:
Hi,
 I'm writing to notify some strange behaviour of keepalived on debian buster.
On the software_design.rst I can read the follow: 
 When running you will see in process list::
 
    PID         111     Keepalived  <-- Parent process monitoring children
                112     \_ Keepalived   <-- VRRP child
                113     \_ Keepalived   <-- Healthchecking child
 
This is the normal behaviout that I can see on Debian 9 and keepalived 1.3.x
But on debian buster in all the installation that I do , either from debian repository or from source (downloaded from github) I don't have the 3 PID.
 
The Healthchecking child is missing.
 
I download the follow versions that resolv this issue: https://github.com/acassen/keepalived/issues/1364
wget https://github.com/acassen/keepalived/tarball/18262c7 -O keepalived-v2.0.18-g18262c7.tar
 
I use this version at the last after the 2.0.10, 2.0.17 and 2.0.18 but I have always same behaviour
 
So, follow all the information on the debian and keepalived:
 
the version of keepalived is:
 
:/home/ansible/acassen-keepalived-18262c7/doc/source# /usr/sbin/sbin/keepalived -v
Keepalived v2.0.18 (unknown)
 
Copyright(C) 2001-2019 Alexandre Cassen, <acassen@...>
 
Built with kernel headers for Linux 4.19.67
Running on Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
 
configure options: --prefix=/usr/sbin/
 
Config options:  LIBIPTC LIBIPSET_DYNAMIC NFTABLES LVS VRRP VRRP_AUTH OLD_CHKSUM_COMPAT FIB_ROUTING
 
System options:  PIPE2 SIGNALFD INOTIFY_INIT1 VSYSLOG EPOLL_CREATE1 IPV4_DEVCONF IPV6_ADVANCED_API LIBNL3 RTA_ENCAP RTA_EXPIRES RTA_NEWDST RTA_PREF FRA_SUPPRESS_PREFIXLEN FRA_SUPPRESS_IFGROUP FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK RTEXT_FILTER_SKIP_STATS FRA_L3MDEV FRA_UID_RANGE RTAX_FASTOPEN_NO_COOKIE RTA_VIA FRA_OIFNAME FRA_PROTOCOL FRA_IP_PROTO FRA_SPORT_RANGE FRA_DPORT_RANGE RTA_TTL_PROPAGATE IFA_FLAGS IP_MULTICAST_ALL LWTUNNEL_ENCAP_MPLS LWTUNNEL_ENCAP_ILA LIBIPTC LIBIPSET_PRE_V7 NET_LINUX_IF_H_COLLISION LIBIPVS_NETLINK IPVS_DEST_ATTR_ADDR_FAMILY IPVS_SYNCD_ATTRIBUTES IPVS_64BIT_STATS VRRP_VMAC VRRP_IPVLAN IFLA_LINK_NETNSID CN_PROC SOCK_NONBLOCK SOCK_CLOEXEC O_PATH GLOB_BRACE INET6_ADDR_GEN_MODE VRF SO_MARK SCHED_RT SCHED_RESET_ON_FORK
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
 
uname -a
Linux gideblbtest1 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
 
cat /etc/keepalived/keepalived.conf
global_defs {
  router_id lbtest1 # 100
  enable_script_security
}
 
 
vrrp_script chk_haproxy {
        script "/usr/bin/pgrep haproxy"
        interval 1
#       weight 2
}
 
vrrp_instance lbtest {
       
        interface ens192
 
        state BACKUP
 
        garp_master_delay 1
        advert_int 2
 
        virtual_router_id 216
        priority 100    # 99 on master, 98 on backup
 
        authentication {
                auth_type PASS
                auth_pass eI6Kk5
        }
 
        virtual_ipaddress {
           192.168.0.216/24 dev ens192 label ens192:VRRP_IP
        }
 
        track_script {
            chk_haproxy
        }
        notify /usr/local/bin/keepalivednotify.sh keepalived_script
}

 
cat /usr/local/bin/keepalivednotify.sh
#!/bin/bash
GROUP= $1
NAME=$2
STATE=$3
 
case $STATE in
        "MASTER") /bin/echo 1 > /tmp/keepalived.state
                  exit 0
                  ;;
        "BACKUP") /bin/echo 0 > /tmp/keepalived.state
                  exit 0
                  ;;
        "FAULT")  /bin/echo -1 > /tmp/keepalived.state
                  exit 0
                  ;;
        *)        /bin/echo -2 > /tmp/keepalived.state
                  exit 0
                  ;;
esac
 
This is the log of startup:
 
Oct 16 10:54:54 gideblbtest1 Keepalived[16726]: Starting Keepalived v2.0.18 (unknown)
Oct 16 10:54:54 gideblbtest1 Keepalived[16726]: WARNING - keepalived was build for newer Linux 4.19.67, running on Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20)
Oct 16 10:54:54 gideblbtest1 Keepalived[16726]: Command line: '/usr/sbin/sbin/keepalived' '-D'
Oct 16 10:54:54 gideblbtest1 Keepalived[16726]: Opening file '/etc/keepalived/keepalived.conf'.
Oct 16 10:54:54 gideblbtest1 Keepalived[16727]: Starting VRRP child process, pid=16728
 
#ps -eaf | grep keep
root      16727      1  0 10:54 ?        00:00:00 /usr/sbin/sbin/keepalived -D
root      16728  16727  0 10:54 ?        00:00:04 /usr/sbin/sbin/keepalived -D
I can't see the third pid 🙁
 
 
Please let me to know,
Best Regards,
Antonio

Unfortunately the documentation is not completely up to date. Your configuration has no healthchecker elements (no virtual servers) and so the healthchecker child process is not run, in order to save some system resources. Equally, if there is no VRRP element to the configuration, the vrrp child process is not run.

I hope that helps,

Quentin Armitage

vot4anto@...
 

Yes!! 
I always read the documentation and I had a lot of headache to find the solution on kernel side, network side and other.

Really thank