я использую оставайся живым и прочтите keepalived.conf.SYNOPSIS. Все перепробовала, вроде нравится. Что бы я ни делал, я не могу заставить свой резервный сервер взять на себя VIP быстрее, чем 10 секунд, когда главный сервер перезагружается.
В keepalived.conf Я использую выглядит так:
global_defs
{
# don't run scripts configured to be run as root if any part of the path
# is writable by a non-root user.
enable_script_security 1
# delay for second set of gratuitous ARPs after transition to MASTER
# seconds, default 5, 0 for no second set
vrrp_garp_master_delay 0
# number of gratuitous ARP messages to send at a time after transition to
# MASTER
# default 5
vrrp_garp_master_repeat 1
# delay for second set of gratuitous ARPs after lower priority advert
# received when MASTER
vrrp_garp_lower_prio_delay 0
# number of gratuitous ARP messages to send at a time after lower priority
# advert received when MASTER
vrrp_garp_lower_prio_repeat 1
# minimum time interval for refreshing gratuitous ARPs while MASTER
# secs, default 0 (no refreshing)
vrrp_garp_master_refresh 10
# number of gratuitous ARP messages to send at a time while MASTER
# default 1
vrrp_garp_master_refresh_repeat 1
# delay in ms between gratuitous ARP messages sent on an interface
# decimal, seconds (resolution usecs). Default 0.
vrrp_garp_interval 0.001
# delay in ms between unsolicited NA messages sent on an interface
# decimal, seconds (resolution usecs). Default 0.
vrrp_gna_interval 0.001
}
vrrp_instance VI_1
{
state {{STATE}}
interface {{INTERFACE}}
virtual_router_id {{VRID}}
priority {{PRIORITY}}
advert_int 1
debug 4
authentication
{
auth_type PASS
auth_pass {{PASSWORD}}
}
virtual_ipaddress
{
{{IP_VIRTUAL}}
}
}