keepalived的同步组和sorry地址
keepalived的conf文件中有不少配置,这里再特别提下两个现网中经常会用到的。一个是sorry server,一个是vrrp_sync_group 。
一、sorry server
该参数在所有realserver都无法正常访问的时候,sorry server会作为realserver来用,所以sorry server可以用来做升级维护页,也可以作临时备用realserver 。常用配置如下:
这里可以参看官方UserGuide文件。
二、vrrp_sync_group
vrrp_sync_group的应用场景为:如果路由有2个网段,一个内网,一个外网,每个网段开启一个VRRP实例,假设VRRP配置为检查内网,那么当外网出现问题 时,VRRPD会认为自己是健康的,则不会发送Master和Backup的切换,从而导致问题,Sync Group可以把两个实例都放入Sync Group,这样的话,Group 里任何一个实例出现问题都会发生切换。
这里可以参看LVS官方给出的一个配置示例:
 1vrrp_sync_group VG1 {
 2    group {
 3        VI_1
 4        VI_2
 5    }
 6}
 7vrrp_instance VI_1 {
 8    state MASTER
 9    interface eth0
10    virtual_router_id 51
11    priority 100
12    advert_int 1
13    authentication {
14        auth_type PASS
15        auth_pass 1111
16    }
17    virtual_ipaddress {
18        10.23.8.80
19    }
20}
21vrrp_instance VI_2 {
22    state MASTER
23    interface eth1
24    virtual_router_id 51
25    priority 100
26    advert_int 1
27    authentication {
28        auth_type PASS
29        auth_pass 1111
30    }
31    virtual_ipaddress {
32        172.18.1.254
33    }
34}
35virtual_server 10.23.8.80 80 {
36    delay_loop 6
37    lb_algo wlc
38    lb_kind NAT
39    persistence_timeout 600
40    protocol TCP
41    real_server 172.18.1.11 80 {
42        weight 100
43        TCP_CHECK {
44            connect_timeout 3
45        }
46    }
47    real_server 172.18.1.12 80 {
48        weight 100
49        TCP_CHECK {
50            connect_timeout 3
51        }
52    }
53    real_server 172.18.1.13 80 {
54        weight 100
55        TCP_CHECK {
56            connect_timeout 3
57        }
58    }
59}
LVS页面上关于keepalived vrrp_sync_group的配置页面为:http://www.linuxvirtualserver.org/docs/ha/keepalived.html
捐赠本站(Donate)
 如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))
- Author: shisekong
- Link: https://blog.361way.com/sorry-server-sync-group/6626.html
- License: This work is under a 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work.
