Page MenuHomeVyOS Platform

VRRP: Is it necessary to support switches between master and backup with script?
Closed, InvalidPublic

Description

Hi,

The original keepalived can support switches between master and backup with script like this:

keepalived.conf

...
vrrp_script check_program_status {
    script "/etc/keepalived/script/check_program_status.sh"
    interval 3
    weight 60
    fall 2
    rise 1
}

vrrp_instance VI_1 {
    ...
    state BACKUP
    interface eth1
    priority 100

    track_script {
        check_program_status
    }

    notify_master "/etc/keepalived/script/notify.sh master"
    notify_backup "/etc/keepalived/script/notify.sh backup"
}

If the script check_program_status.sh return non zero, the master node will decrease the value of priority and become the backup node, the backup node will become the master node. The notify.sh will complete assigned tasks when status switching between master and backup.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

arvin created this object in space S1 VyOS Public.
Viacheslav added a subscriber: Viacheslav.

@arvin This functions in all versions of VyOS.

Example:

set high-availability vrrp group FOO health-check failure-count '2'
set high-availability vrrp group FOO health-check interval '3'
set high-availability vrrp group FOO health-check script '/config/vrrp_check.sh'
set high-availability vrrp group FOO interface 'eth1'
set high-availability vrrp group FOO no-preempt
set high-availability vrrp group FOO priority '150'
set high-availability vrrp group FOO transition-script backup '/config/vrrp_bkup.sh'
set high-availability vrrp group FOO transition-script master '/config/vrrp_master.sh'
set high-availability vrrp group FOO virtual-address '192.0.2.254/32'
set high-availability vrrp group FOO vrid '150'

Let us know if I don't understand you correctly and it was a feature request. In that case, describe more information about what exactly you need in the VyOS.
I close it. Re-open if necessary.