Skip to content

Instantly share code, notes, and snippets.

@fengchj
Last active August 29, 2015 14:05
Show Gist options
  • Save fengchj/66f5c6e5afc4603942aa to your computer and use it in GitHub Desktop.
Save fengchj/66f5c6e5afc4603942aa to your computer and use it in GitHub Desktop.
keepalived.conf
global_defs {
notification_email {
xxx@gmail.com
}
notification_email_from keepalived@10-15-8-101
smtp_server 127.0.0.1
smtp_connect_timeout 4
lvs_id nginx
}
vrrp_script chk_nginx {
script "pidof nginx"
interval 1
weight 2
}
vrrp_instance WEB_102 {
state BACKUP
interface eth0
virtual_router_id 102
priority 90
advert_int 1
mcast_src_ip 10.15.8.101
smtp_alert
authentication {
auth_type PASS
auth_pass keep@lived
}
virtual_ipaddress {
10.15.8.102
}
track_script {
chk_nginx
}
}
global_defs {
notification_email {
xxx@gmail.com
}
notification_email_from keepalived@10-15-8-100
smtp_server 127.0.0.1
smtp_connect_timeout 4
lvs_id nginx
}
vrrp_script chk_nginx {
script "pidof nginx"
interval 1
weight 2
}
vrrp_instance WEB_102 {
state MASTER
interface eth0
virtual_router_id 102
priority 91
advert_int 1
mcast_src_ip 10.15.8.100
smtp_alert
authentication {
auth_type PASS
auth_pass keep@lived
}
virtual_ipaddress {
10.15.8.100
}
track_script {
chk_nginx
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment