forked from zhangguanzhang/Dockerfile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeepalived.conf
More file actions
35 lines (33 loc) · 982 Bytes
/
Copy pathkeepalived.conf
File metadata and controls
35 lines (33 loc) · 982 Bytes
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
global_defs {
router_id your_hostname
vrrp_version 2
vrrp_garp_master_delay 1
vrrp_garp_master_refresh 2
#Uncomment the next line if you'd like to use unique multicast groups
#vrrp_mcast_group4 224.0.0.{{VRID}}
}
vrrp_script chk_server {
script "ss -ltn 'src {{CHECK_IP}}' | grep ':{{CHECK_PORT}} '"
timeout 1
interval 1 # check every 1 second
fall 2 # require 2 failures for KO
rise 2 # require 2 successes for OK
}
vrrp_instance lb-vips {
state BACKUP
interface {{INTERFACE}}
virtual_router_id {{VRID}}
priority 100
advert_int 1
nopreempt
track_script {
chk_server
}
authentication {
auth_type PASS
auth_pass blahblah
}
virtual_ipaddress {
{{VIRTUAL_IP}}/{{VIRTUAL_MASK}} dev {{INTERFACE}}
}
}