add
This commit is contained in:
28
4-广西移动项目/高可用配置/前端负载均衡/keepalived-1.conf
Normal file
28
4-广西移动项目/高可用配置/前端负载均衡/keepalived-1.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
! Configuration File for keepalived
|
||||
global_defs {
|
||||
router_id web-1 ##标识节点的字符串,通常为本机hostname
|
||||
}
|
||||
vrrp_script chk_haproxy {
|
||||
script "/etc/keepalived/haproxy_check.sh" ##执行脚本位置
|
||||
interval 2 ##检测时间间隔
|
||||
weight -20 ##如果条件成立则权重减20
|
||||
}
|
||||
vrrp_instance VI_2 {
|
||||
state MASTER ## 主节点为MASTER,备份节点为BACKUP-该配置非常重要
|
||||
interface ens5 ## 绑定虚拟IP的网络接口(网卡可以使用ifconfig查看)
|
||||
virtual_router_id 110 ## 虚拟路由ID号(主备节点一定要相同)-该配置非常重要
|
||||
mcast_src_ip 10.165.81.66 ## 本机ip地址
|
||||
priority 100 ##优先级配置(0-254的值),一般主节点的权重大于备份节点
|
||||
nopreempt
|
||||
advert_int 2 ## 组播信息发送间隔,俩个节点必须配置一致,默认1s
|
||||
authentication { ## 认证匹配
|
||||
auth_type PASS
|
||||
auth_pass woshinibaba
|
||||
}
|
||||
track_script {
|
||||
chk_haproxy
|
||||
}
|
||||
virtual_ipaddress {
|
||||
10.165.81.86 ## 虚拟ip
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user