I've been using Keepalived for over a decade and in most setups with so-called track_scripts. This has always worked very well and helped to detect application issues and therefore trigger an automatic failover.
On a new Debian 12 (Bookworm) setup I ran into a problem though, once the Keepalived config (/etc/keepalived/keepalived.conf) was reloaded:
2024-07-24T06:43:29.025785+02:00 debian Keepalived_vrrp[769590]: (/etc/keepalived/keepalived.conf: Line 61) (vipgw) track script chk_nginx_curl not found, ignoring...
2024-07-24T06:43:29.025850+02:00 debian Keepalived_vrrp[769590]: (/etc/keepalived/keepalived.conf: Line 62) (vipgw) track script chk_failover_trigger not found, ignoring...
2024-07-24T06:43:29.025923+02:00 debian Keepalived_vrrp[769590]: Warning - script chk_failover_trigger is not used
2024-07-24T06:43:29.026011+02:00 debian Keepalived_vrrp[769590]: Warning - script chk_nginx_curl is not used
At first I expected a problem with the Keepalived script_user, but that wasn't the case. Then I stumbled on a GitHub issue which mentioned that a vrrp_script is ignored without specifying a script user. But having defined a script_user already, I could rule this out, too.
Looking at configurations from previous setups showed that I've always used the following order in the config file in the past:
global defs { }
vrrp_script { }
vrrp_instance { }
But on the new Debian 12 setup I've defined the vrrp_script entries at the bottom:
global defs { }
vrrp_instance { }
vrrp_script { }
Could it be, that Keepalived parses the config from top to bottom and therefore can't find the vrrp_script references inside the vrrp_instance's track_script { } context?
As it turns out: yes!
Once the order in the config file was changed and the vrrp_script entries were defined before the vrrp_instance entries, Keepalived loaded the scripts correctly and started executing them at the defined intervals.
No comments yet.
AWS Android Ansible Apache Apple Atlassian BSD Backup Bash Bluecoat CMS Chef Cloud Coding Consul Containers CouchDB DB DNS Database Databases Docker ELK Elasticsearch Filebeat FreeBSD Galera Git GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Influx Internet Java KVM Kibana Kodi Kubernetes LVM LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS Office OpenSearch PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Python Rancher Rant Redis Roundcube SSL Samba Seafile Security Shell SmartOS Solaris Surveillance Systemd TLS Tomcat Ubuntu Unix VMWare VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder