- 论坛徽章:
- 0
|
! Configuration File for keepalived
vrrp_script chk_haproxy {
script "killall -0 haproxy" # cheaper than pidof
interval 2 # check every 2 seconds
weight -10 # default prio: -2 if connect fails
fall 3 # require 2 failures for failures
rise 1 # require 1 sucesses for ok
}
vrrp_script chk_http_port {
script "/tcp/127.0.0.1/80" # connects and exits
interval 1 # check every 1 second
weight -10 # default prio: -2 if connect fails
fall 3 # require 2 failures for failures
rise 1 # require 1 sucesses for ok
}
vrrp_script chk_http {
script "/etc/keepalived/check_http.sh" # connects and exits
interval 1 # check every 1 second
weight -10 # default prio: -2 if connect fails
fall 3 # require 2 failures for failures
rise 1 # require 1 sucesses for ok
}
vrrp_script chk_schedown {
script "if [ -f /var/run/down ]; then exit 1; else exit 0; fi"
interval 1 # check every 10 seconds
weight -10 # if failed, decrease 40 of the priority
fall 1 # require 2 failures for failures
rise 1 # require 1 sucesses for ok
}
global_defs {
notification_email {
xxx.cn
}
notification_email_from sns-keepalive-A@xxx.cn
#smtp_server 127.0.0.1
#smtp_connect_timeout 30
router_id Haproxy-haB
}
vrrp_instance VI_1 {
state BACKUP
nopreempt
garp_master_delay 2
preempt_delay 300
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.0.188
}
track_script{
chk_haproxy
chk_http_port
chk_http
chk_schedown
}
track_interface{
eth0
eth1
}
} |
|