-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeepalived.conf
54 lines (49 loc) · 1.08 KB
/
keepalived.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#当check脚本返回-1,同时配置的weight小于0,即做减权重操作
vrrp_script check_die
{
script "/etc/keepalived/check.sh"
interval 1
weight -253
}
#当check脚本返回0,同时配置的weight大于0,即做加权重操作
vrrp_script check_realived
{
script "/etc/keepalived/check.sh"
interval 1
weight 253
}
vrrp_instance VI_2
{
#vip绑定的设备名称
interface ens160
#节点初始角色,均为backup,防止vip抢占带来的流量切换影响
state BACKUP
#vrrp广播的route id,区分一组广播消息
virtual_router_id 51
#初始化权重,最大254
priority 254
#方向路由VIP定义
virtual_ipaddress
{
2.3.255.240 dev ens160
2.3.255.241 dev ens160
2.3.255.242 dev ens160
}
#监控设备对象
track_interface
{
ens160
}
#简单的密码验证方式配置
authentication
{
auth_type PASS
auth_pass topsecret
}
#监控脚本
track_script
{
check_die
check_realived
}
}