notify_master |:当前节点成为主节点时触发的脚本
notify_backup |:当前节点转为备节点时触发的脚本
notify_fault |:当前节点转为“失败”状态时触发的脚本
notify |:通用格式的通知触发机制,一个脚本可完成以上三种状态的转换时的通知
vim /etc/keepalived/keepalived.conf! Configuration File for keepalived
global_defs {
notification_email {
[email protected]
}
notification_email_from [email protected]
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id proxy1
vrrp_mcast_group4 224.1.1.1
}
vrrp_instance VI_1 {
state MASTER
interface eth1
virtual_router_id 66
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 123456
}
virtual_ipaddress {
172.18.0.200/16
}
notify_master "/etc/keepalived/notify.sh master&