Hi all,
I'm having a problem with the keepalived track_script feature. What I am
trying to achieve is the following:
- An IP address is handled by keepalived; it should fail over between 2
different machines;
- An FTP daemon is started and stopped through the notify_master and
notify_backup feature;
- When a link fails, or when the vsftpd program failed, the service
should failover to the other machine.
All this works, except for the check whether the vsftpd program still
functions. I'm trying to fix this by using the following configuration:
<--begin-->
vrrp_script chk_vsftpd {
script "/usr/bin/killall -0 vsftpd"
interval 1
weight -10
}
global_defs {
notification_email {
wietse.muizelaar@...
}
notification_email_from wietse.muizelaar@...
router_id uplwa-prod
}
vrrp_instance VI_1 {
state MASTER
priority 100
interface bond0.530
virtual_router_id 151
authentication {
auth_type PASS
auth_pass xxxxxx
}
virtual_ipaddress {
145.58.xx.xx/24 brd 145.58.xx.255 dev bond0.530
}
notify_master "/e/ha/uplw/bin/notify start"
notify_backup "/e/ha/uplw/bin/notify stop"
track_script {
chk_vsftpd
}
smtp_alert
}
<--end-->
(I obfuscated the IP and the password)
The notify-script contains the following:
<--begin-->
#!/bin/sh
# notify_master / notify_backup scriptje
/etc/init.d/vsftpd "$@"
<--end-->
After compiling keepalived with the patches by Ward Wouts
(http://marc.info/?l=keepalived-devel&m=116308799123607&w=2) and
Pierre-Yves Ritschard
(http://marc.info/?l=keepalived-devel&m=116464867107582&w=2), I see the
checkscripts work, and when I kill vsftpd, I get the following
logmessages:
Aug 28 17:42:58 gyro14 Keepalived_vrrp: VRRP_Script(chk_vsftpd) failed
But I wanted there to be a failover of the service, but this doesn't
happen.
Can anyone tell me what I'm doing wrong? Do I misunderstand the usage of
track_scripts? Please help!
Met vriendelijke groet,
--
Wietse Muizelaar, internetbeheerder /\
NPO ICT Internetbeheer /NPO/\
Sumatralaan 45, 1217 GP Hilversum, Peperbus (12.103) \ /\/
beheer@..., +31 35 677 3555 \/
|