Keepalived安装与配置(代码详解)
#全局定义块global_defs { # 邮件通知配置notification_email {
email1
email2
}
notification_email_from email
smtp_server host
smtp_connect_timeout num
lvs_id string
router_id string ## 标识本节点的字条串,通常为hostname}#VRRP 实例定义块vrrp_sync_group string {
group { string
string
}
}
vrrp_instance string {
state MASTER|BACKUP
virtual_router_id num
interface string
mcast_src_ip @IP
priority num
advert_int num
nopreempt
smtp_alert
lvs_sync_daemon_interface string
authentication {
auth_type PASS|AH
auth_pass string
}
virtual_ipaddress {# Block limited to 20 IP addresses @IP
@IP
@IP
}
}#虚拟服务器定义块virtual_server (@IP PORT)|(fwmark num) {
delay_loop num
lb_algo rr|wrr|lc|wlc|sh|dh|lblc
lb_kind NAT|DR|TUN
persistence_timeout num
protocol TCP|UDP
real_server @IP PORT {
weight num
notify_down /path/script.sh
TCP_CHECK {
connect_port num
connect_timeout num
}
}
real_server @IP PORT {
weight num
MISC_CHECK {
misc_path /path_to_script/script.sh(or misc_path “/path_to_script/script.sh ”)
}
}
real_server @IP PORT {
weight num
HTTP_GET|SSL_GET {
url {
# You can add multiple url block path alphanum
digest alphanum
}
connect_port num
connect_timeout num
nb_get_retry num
delay_before_retry num
}
}
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
页:
[1]