标签:错误 ipaddress router ipad min 需要 and oss tutorial
1、目的6、配置keepalived(master节点)
global_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 30
router_id LVS_DEVEL
}
//以下部分是检查haproxy进程的脚本
vrrp_script chk_haproxy {
script "killall -0 haproxy"
interval 1
weight -5
fall 3
rise 5
}
vrrp_instance VI_1 {
state MASTER //此为主节点所以设置为master
interface ens33 //指定网卡来映射虚拟ip
virtual_router_id 51 //backup节点应与此id一致,否则vip无法漂移
priority 200 //值越大优先权越高,所以backup节点要低于此值
advert_int 1
authentication { //与backup节点认证的方式,需一致
auth_type PASS
auth_pass 1111
}
virtual_ipaddress { //虚拟节点的ip(vip)
192.168.0.11
}
track_script { //指定haproxy脚本的名称
chk_haproxy
}
}
virtual_server 192.168.0.11 8600 { //指定vip的端口为8600
delay_loop 6
lb_algo rr
lb_kind NAT
persistence_timeout 50
protocol TCP
real_server 192.168.0.101 5000 { //指定haproxy的地址与端口
weight 1
}
}
Haproxy+Keepalived(双机热备)搭建高可用web架构
标签:错误 ipaddress router ipad min 需要 and oss tutorial
原文地址:http://blog.51cto.com/mysky0708/2300144