keepalived 做主备,检查80端口
keepalived 的配置文件,主和备一样,只有priority 150 的值不同 ! Configuration File for keepalivedglobal_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 127.0.0.1
smtp_connect_timeout 5
router_id Director1
}
vrrp_script chk_80_port {
script "/tcp/127.0.0.1/80"
interval 1
weight -60
}
vrrp_instance VI_1 {
state MASTER
interface eth1
virtual_router_id 51
priority 150 #主库为 priority 200
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
172.16.2.122
}
track_script {
chk_80_port
}
}
页:
[1]