0

Describe the bug I'm trying to create a Master Slave setup, but the Master is set in both sides. I'm seeing to many messages like this on keepalived.log Aug 5 21:00:03 CENVLIFEPROXB Keepalived_vrrp[3983]: (VI_1) Received advert from 10.200.6.22 with lower priority 150, ours 200, forcing new election

Expected behavior Master in one server and slave in other

Keepalived version 2.2.4 Output of keepalived -v Keepalived v2.2.4 (08/21,2021)

Copyright(C) 2001-2021 Alexandre Cassen, acassen@gmail.com

Built with kernel headers for Linux 4.19.194 Running on Linux 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) Distro: Debian GNU/Linux 10 (buster)

configure options: --build=x86_64-linux-gnu --prefix=/usr --includedir=/include --mandir=/share/man --infodir=/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=/lib/x86_64-linux-gnu --libexecdir=/lib/x86_64-linux-gnu --runstatedir=/run --disable-maintainer-mode --enable-snmp --enable-sha1 --enable-snmp-rfcv2 --enable-snmp-rfcv3 --enable-dbus --enable-dbus-create-instance --enable-json --enable-bfd --disable-systemd build_alias=x86_64-linux-gnu

Config options: LVS VRRP VRRP_AUTH VRRP_VMAC JSON BFD OLD_CHKSUM_COMPAT SNMP_V3_FOR_V2 SNMP_VRRP SNMP_CHECKER SNMP_RFCV2 SNMP_RFCV3 DBUS DBUS_CREATE_INSTANCE INIT=SYSV

System options: VSYSLOG MEMFD_CREATE IPV4_DEVCONF 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_PROTOCOL FRA_IP_PROTO FRA_SPORT_RANGE FRA_DPORT_RANGE RTA_TTL_PROPAGATE IFA_FLAGS LWTUNNEL_ENCAP_MPLS LWTUNNEL_ENCAP_ILA IPTABLES NET_LINUX_IF_H_COLLISION LIBIPVS_NETLINK IPVS_DEST_ATTR_ADDR_FAMILY IPVS_SYNCD_ATTRIBUTES IPVS_64BIT_STATS VRRP_IPVLAN IFLA_LINK_NETNSID GLOB_BRACE GLOB_ALTDIRFUNC INET6_ADDR_GEN_MODE VRF SO_MARK

Distro (please complete the following information):

  • Name: Debian
  • Version: 10.10
  • Architecture: 64

Configuration file: Master

global_defs {
   max_auto_priority
}
vrrp_script chk_vi_1 {
   script "/etc/keepalived/keepalived-health-checks-1.sh"
   interval 2
   fall 1
   rise 1
   timeout 3
}

! vrrp_primary_node for cenvlifeproxb.aminerals.cl
vrrp_instance VI_1 {
   state MASTER
   interface eth0
   virtual_router_id 30
   priority 200
   advert_int 1
   virtual_ipaddress {
     10.200.6.26/24 dev eth0 label eth0:1
   }
   track_script {
     chk_vi_1
   }
   notify "/etc/keepalived/keepalived-state.sh"
}

Slave

global_defs {
   max_auto_priority
}
vrrp_script chk_vi_1 {
   script "/etc/keepalived/keepalived-health-checks-1.sh"
   interval 2
   fall 1
   rise 1
   timeout 3
}

! vrrp_primary_node for cenvlifeproxa.aminerals.cl
vrrp_instance VI_1 {
   state BACKUP
   interface eth0
   virtual_router_id 30
   priority 150
   advert_int 1
   virtual_ipaddress {
     10.200.6.26/24 dev eth0 label eth0:1
   }
   track_script {
     chk_vi_1
   }
   notify "/etc/keepalived/keepalived-state.sh"
}

Notify and track scripts Notify script

#!/bin/sh
### BEGIN INIT INFO
# Provides:         keepalived-server
# Required-Start:    $local_fs $syslog
# Required-Stop:     $local_fs $syslog
# Should-Start:
# Should-Stop:
# Default-Start:     3 4 5
# Default-Stop:      0 1 6
# Short-Description: keepalived server
# chkconfig: - 80 75
# description: keepalived server
### END INIT INFO
/usr/bin/php /usr/share/artica-postfix/exec.keepalived-state.php --state $1 $2 $3

Track Script

#!/bin/bash
### BEGIN INIT INFO
# Provides:         keepalived-health-checks-1
### END INIT INFO

### BEGIN Proxy INFO
Proxy_id=$(/bin/pidof squid)
if [[ -z $Proxy_id ]]
then
    /usr/bin/php /usr/share/artica-postfix/exec.keepalived-state.php --state primary_node _1 'Proxy is down'
    exit 1
fi
### END Proxy INFO


### BEGIN Proxy INFO
Proxy_id=$(/bin/pidof squid)
if [[ -z $Proxy_id ]]
then
    /usr/bin/php /usr/share/artica-postfix/exec.keepalived-state.php --state primary_node _1 'Proxy is down'
    exit 1
fi
### END Proxy INFO


### BEGIN DISK SPACE INFO
DISK_USAGE_sda1=`/bin/df /dev/sda1 | tail -1 | awk '{print $5}' | sed 's/[^0-9]*//g'`
if (( $DISK_USAGE_sda1 > 96 ))
then
    /usr/bin/php /usr/share/artica-postfix/exec.keepalived-state.php --state primary_node _1 'sda1 low disk space'
    exit 1
fi
### END DISK SPACE INFO

exit 0

System Log entries

Aug  5 20:58:17 CENVLIFEPROXB Keepalived_vrrp[3983]: Sending gratuitous ARP on eth0 for 10.200.6.26
Aug  5 20:58:17 CENVLIFEPROXB Keepalived_vrrp[3983]: Sending gratuitous ARP on eth0 for 10.200.6.26
Aug  5 20:58:17 CENVLIFEPROXB Keepalived_vrrp[3983]: Sending gratuitous ARP on eth0 for 10.200.6.26
Aug  5 20:58:17 CENVLIFEPROXB Keepalived_vrrp[3983]: Sending gratuitous ARP on eth0 for 10.200.6.26
Aug  5 20:58:17 CENVLIFEPROXB Keepalived_vrrp[3983]: Sending gratuitous ARP on eth0 for 10.200.6.26
Aug  5 21:00:01 CENVLIFEPROXB Keepalived_vrrp[3983]: (VI_1) received an unexpected ip number count 0, expected 1!
Aug  5 21:00:02 CENVLIFEPROXB Keepalived_vrrp[3983]: (VI_1) received an unexpected ip number count 0, expected 1!
Aug  5 21:00:03 CENVLIFEPROXB Keepalived_vrrp[3983]: (VI_1) received an unexpected ip number count 0, expected 1!
Aug  5 21:00:03 CENVLIFEPROXB Keepalived_vrrp[3983]: (VI_1) Received advert from 10.200.6.22 with lower priority 150, ours 200, forcing new election
Aug  5 21:00:03 CENVLIFEPROXB Keepalived_vrrp[3983]: (VI_1) Sending/queueing gratuitous ARPs on eth0 for 10.200.6.26
Aug  5 21:00:03 CENVLIFEPROXB Keepalived_vrrp[3983]: Sending gratuitous ARP on eth0 for 10.200.6.26
Aug  5 21:00:03 CENVLIFEPROXB Keepalived_vrrp[3983]: Sending gratuitous ARP on eth0 for 10.200.6.26
Aug  5 21:00:03 CENVLIFEPROXB Keepalived_vrrp[3983]: Sending gratuitous ARP on eth0 for 10.200.6.26

0

Your Answer

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

Browse other questions tagged or ask your own question.