菜单

Keepalived学习笔记,

2019年2月25日 - www6165com

D中华V1和D库罗德2布署keepalived和lvs作主从架构或主主架构,MuranoS1和瑞虎S2配备nginx搭建web站点。

 

3.3.2 LVS
vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
qingean@163.com
}
notification_email_from admin@test.com
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_MASTER
}
vrrp_instance VI_1 {
state MASTER #BACKUP上改动为BACKUP
interface ens4
virtual_router_id 51
priority 100 #BACKUP上修改为90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
193.168.140.80
}
}
virtual_server 193.168.140.80 80 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.255
protocol TCP
real_server 193.168.140.152 80 {
weight 10
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
real_server 193.168.140.224 80 {
weight 10
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}

Keepalived学习笔记,


LVS(Linux Virtual
Server):Linux虚拟服务器,那里透过keepalived作为负载均衡器
奥迪Q3S(Real Server):真实服务器
V汉兰达OdysseyP(Virtual Router Redundancy Protocol): 虚拟路由冗余研究,
化解局域网中配置静态网关现身单点失效现象的路由协议
图片 1

 

1 Keepalived是如何,有哪些功效?
1.1 Keepalived的定义
Keepalived 是贰个依照V奇骏福特ExplorerP协议来兑现的LVS高可用方案
1.2 Keepalived的作用
1.2.1 通过IP漂移实现高可用
主副LVS共享3个虚拟IP,同权且间唯有1个LVS占有VIP并对外提供服务,若该LVS不可用,则VIP漂移至另一台LVS并对外提供劳动;
1.2.2 对奥迪Q5S集群举行情形监控
若LANDS不可用,则keepalived将其从集群中摘除,若奥迪Q5S苏醒,则keepalived将其重新参加集群中。
2 Keepalived有两种格局,各类方式的相同点和差别点是怎么?
2.1 Keepalived的情势连串
Keepalived有3种方式:NAT(地址转换);DWrangler(直接路由);TUN(隧道)
2.2 Keepalived的逐条格局的牵线
2.2.1 NAT
可取:集群中的XC90S能够利用任何协助TCP/IP操作系统,酷威S能够分配Internet的保存私有地址,唯有LVS供给一个合法的IP地址。
缺陷:扩展性有限。当HighlanderS节点拉长到十7个或更加多时,LVS将成为全部系统的瓶颈,因为全数的央求包和回复包都亟待通过LVS再生。
2.2.2 TUN
咱俩发现,许多Internet服务(例如WEB服务器)的乞请包很短小,而应答包平日十分的大。
亮点:LVS只担负将请求包分发给PAJEROS,而EnclaveS将回应包直接发给用户。所以,LVS能处理很了不起的请求量,那种格局,一台载荷均衡能为当先100台的奥迪Q5S服务,LVS不再是系统的瓶颈。
缺陷:可是,那种方法亟待具有的服务器扶助”IP Tunneling”(IP
Encapsulation)协议,作者仅在Linux系统上贯彻了那么些。
2.2.3 DR
可取:和TUN一样,LVS也只是散发请求,应答包通过独立的路由方法再次回到给客户端。与TUN相比较,DCRUISER那种完成格局不需求隧道结构,由此得以采纳超越五成操作系统做为中华VS。
不足:要求LVS的网卡必须与LANDS的网卡在2个网段上
3 差异方式的安插方式,验证办法分别是何等?
3.1 基本的环境要求
需要2台LVS和n(n>=2)台RS
3.1.1 LVS
安装ipvsadm(LVS管理工科具)和keepalived;
开启路由转载作用:
vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
验证:
sysctl -p
net.ipv4.ip_forward = 1
3.1.2 RS
安装httpd(用于最后测试)
3.2 NAT形式配置
3.2.1 环境概述
操作系统 负载均衡形式 VIP NVIP
RHEL7.4 NAT 193.168.140.80 192.168.102.165

LVS1 LVS2 RS1 RS2
ens3:192.168.102.161 ens3:192.168.102.162 ens3:192.168.102.163
ens3:192.168.102.164
ens4:193.168.140.79 ens4:193.168.140.83 网关:192.168.102.165
网关:192.168.102.165

3.2.2 LVS
vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
[email protected]
#故障接受联系人
}
notification_email_from
[email protected]
#故障发赠与外人
smtp_server 127.0.0.1 #本机发送邮件
smtp_connect_timeout 30
router_id LVS_MASTER #BACKUP上改动为LVS_BACKUP
}
vrrp_instance VI_1 {
state MASTER #BACKUP上修改为BACKUP
interface ens4
virtual_router_id 51 #虚拟路由标识,主从相同
priority 100 #BACKUP上改动为90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111 #焦点认证密码必须一致
}
virtual_ipaddress {
193.168.140.80 #虚拟IP(VIP)
}
}
vrrp_instance LAN_GATEWAY { #概念网关
state MASTER #BACKUP上修修改改为BACKUP
interface ens3
virtual_router_id 62 #虚拟路由ID,主从相同
priority 100 #BACKUP上修改为90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress { #ens3网关虚拟IP
192.168.102.165
}
}
virtual_server 192.168.102.165 80 { #概念内网网关虚拟IP和端口
delay_loop 6 #检查RS时间,单位秒
lb_algo rr
#安装负载调度算法,轮叫(rr)、加权轮叫(wrr)、最小连接(lc)、加权最小连接(wlc)、基于局地性最小连接(lblc)、带复制的根据局地性最少链接(lblcr)、目的地方散列(dh)和源地址散列(sh)
lb_kind NAT #安装LVS负载均衡NAT方式
persistence_timeout 50
#同一IP的连年60秒内被分配到同样台实在服务器(测试时建议改为0)
protocol TCP #利用TCP协议检查KugaS状态
real_server 192.168.102.161 80 { #首先个网关节点
weight 3 #节点权重值
TCP_CHECK { #健检方式
connect_timeout 3 #连天超时
nb_get_retry 3 #重试次数
delay_before_retry 3 #重试间隔/S
}
}
real_server 192.168.102.162 80 { #第四个网关节点
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
}
virtual_server 193.168.140.80 80{ #概念虚拟IP
delay_loop 6
lb_algo rr
lb_kind NAT
persistence_timeout 50
protocol TCP
real_server 192.168.102.163 80 { #第一个RS
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
real_server 192.168.102.164 80 { #第二个RS
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}
3.2.3 RS
为有着福睿斯S添加网关为192.168.102.165:
vim /etc/sysconfig/network-scripts/ifcfg-ens3
GATEWAY=192.168.102.165
重启; 使用route –n查看是或不是成功
IPVS connection entries
pro expire state source virtual destination
TCP 01:54 FIN_WAIT 10.167.225.60:53882 193.168.140.80:80
192.168.102.163:80
TCP 00:37 NONE 10.167.225.60:0 193.168.140.80:80 192.168.102.163:80

3.3 DPAJERO方式配置
3.3.1 环境概述
操作系统 负载均衡情势 VIP
RHEL7.4 DR 193.168.140.80

LVS1 LVS2 RS1 RS2
ens4:193.168.140.79 ens4:193.168.140.83 ens4:193.168.140.152
ens4:193.168.140.224

3.3.2 LVS
vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
[email protected]
}
notification_email_from
[email protected]
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_MASTER
}
vrrp_instance VI_1 {
state MASTER #BACKUP上修修改改为BACKUP
interface ens4
virtual_router_id 51
priority 100 #BACKUP上改动为90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
193.168.140.80
}
}
virtual_server 193.168.140.80 80 {
delay_loop 6
lb_algo rr
lb_kind DR
nat_mask 255.255.255.255
protocol TCP
real_server 193.168.140.152 80 {
weight 10
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
real_server 193.168.140.224 80 {
weight 10
TCP_CHECK {
connect_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}

3.3.3 RS
为所有RS修改sysctl.conf
net.ipv4.conf.lo.arp_ignore= 1
net.ipv4.conf.lo.arp_announce= 2
net.ipv4.conf.all.arp_ignore= 1
net.ipv4.conf.all.arp_announce= 2
net.ipv4.ip_forward= 1
执行/sbin/ifconfig lo:0 193.168.140.80 broadcast 193.168.140.80 netmask
255.255.255.255
可用route –n查看是还是不是成功
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 193.168.1.1 0.0.0.0 UG 100 0 0 ens4
193.168.0.0 0.0.0.0 255.255.0.0 U 100 0 0 ens4
193.168.140.80 0.0.0.0 255.255.255.255 UH 0 0 0 lo
若不成功施行/sbin/route add -host 193.168.140.80 dev lo:0
3.4 验证格局
3.4.1 全数机器关闭防火墙:
systemctl stop firewalld
3.4.2 全部宝马X5S写入测试页和开启httpd服务
RS1:echo “RS1″ > /var/www/html/index.html
RS2:echo “RS2″ > /var/www/html/index.html
systemctl start httpd
3.4.3 主副LVS开启keepalived服务
systemctl start keepalived
3.4.4 访问
浏览器访问
刷新会交替体现凯雷德S1或凯雷德S2
3.4.5 查看当前测试机的走访请求被转载到哪个服务器
ipvsadm –lcn
IPVS connection entries
pro expire state source virtual destination
TCP 01:54 FIN_WAIT 10.167.225.60:53882 193.168.140.80:80
192.168.102.163:80
TCP 00:37 NONE 10.167.225.60:0 193.168.140.80:80 192.168.102.163:80
3.4.6 测试
仿照宕掉主LVS,服务器照常工作,再宕掉Web1,这时只会显得Web2,那样就贯彻IP负载均衡,高可用集群。当主LVS苏醒后,会切换到主动服务器,假诺Keepalived监控模块检查和测试web故障复苏后,恢复的主机又将此节点参预集群系统中。

注 LVS(Linux Virtual
Server):Linux虚拟服务器,那里通过keepalived作为负载均衡器 途达S(Real
Server):真实服务器 V奥迪Q7汉兰达P(Virtual Router Rubicon…

客户端实行测试:

[root@client ~]# for i in {1..20};do curl http://192.168.4.120;done   #客户端正常访问
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>

[root@DR1 ~]# systemctl stop keepalived.service   #关闭DR1的keepalived服务

[root@DR2 ~]# systemctl status keepalived.service   #观察DR2,可以看到DR2已经进入MASTER状态
● keepalived.service - LVS and VRRP High Availability Monitor
   Loaded: loaded (/usr/lib/systemd/system/keepalived.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-09-04 11:33:04 CST; 7min ago
  Process: 12983 ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 12985 (keepalived)
   CGroup: /system.slice/keepalived.service
           ├─12985 /usr/sbin/keepalived -D
           ├─12988 /usr/sbin/keepalived -D
           └─12989 /usr/sbin/keepalived -D

Sep 04 11:37:41 happiness Keepalived_healthcheckers[12988]: SMTP alert successfully sent.
Sep 04 11:40:22 happiness Keepalived_vrrp[12989]: VRRP_Instance(VIP_1) Transition to MASTER STATE
Sep 04 11:40:23 happiness Keepalived_vrrp[12989]: VRRP_Instance(VIP_1) Entering MASTER STATE
Sep 04 11:40:23 happiness Keepalived_vrrp[12989]: VRRP_Instance(VIP_1) setting protocol VIPs.
Sep 04 11:40:23 happiness Keepalived_vrrp[12989]: Sending gratuitous ARP on eno16777736 for 192.168.4.120
Sep 04 11:40:23 happiness Keepalived_vrrp[12989]: VRRP_Instance(VIP_1) Sending/queueing gratuitous ARPs on eno16777736 for 192.168.4.120
Sep 04 11:40:23 happiness Keepalived_vrrp[12989]: Sending gratuitous ARP on eno16777736 for 192.168.4.120
Sep 04 11:40:23 happiness Keepalived_vrrp[12989]: Sending gratuitous ARP on eno16777736 for 192.168.4.120
Sep 04 11:40:23 happiness Keepalived_vrrp[12989]: Sending gratuitous ARP on eno16777736 for 192.168.4.120
Sep 04 11:40:23 happiness Keepalived_vrrp[12989]: Sending gratuitous ARP on eno16777736 for 192.168.4.120

[root@client ~]# for i in {1..20};do curl http://192.168.4.120;done   #可以看到客户端正常访问
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>
<h1> 192.168.4.119 RS2 server</h1>
<h1> 192.168.4.118 RS1 server </h1>

1 Keepalived是怎么着,有怎么样功效?
1.1 Keepalived的定义
Keepalived 是贰个基于V哈弗讴歌RDXP协议来落到实处的LVS高可用方案
1.2 Keepalived的作用
1.2.1 通过IP漂移实现高可用
主副LVS共享1个虚拟IP,同权且间只有一个LVS占有VIP并对外提供服务,若该LVS不可用,则VIP漂移至另一台LVS并对外提供劳动;
1.2.2 对劲客S集群实市场价格况监察和控制
若SportageS不可用,则keepalived将其从集群中摘除,若奇骏S苏醒,则keepalived将其重新参预集群中。
2 Keepalived有两种形式,各样形式的相同点和分化点是何许?
2.1 Keepalived的情势连串
Keepalived有3种方式:NAT(地址转换);D奇骏(直接路由);TUN(隧道)
2.2 Keepalived的各样方式的介绍
2.2.1 NAT
优点:集群中的福睿斯S能够利用别的来帮衬助TCP/IP操作系统,昂CoraS能够分配Internet的保留私有地址,唯有LVS必要一个官方的IP地址。
缺点:扩大性有限。当帕杰罗S节点增加到十多少个或越来越多时,LVS将变成全方位种类的瓶颈,因为兼具的伏乞包和答复包都急需通过LVS再生。
2.2.2 TUN
小编们发现,许多Internet服务(例如WEB服务器)的恳求包很短小,而应答包平时相当大。
可取:LVS只承担将请求包分发给EnclaveS,而EvoqueS将回应包直接发给用户。所以,LVS能处理很伟大的请求量,那种格局,一台载荷均衡能为跨越100台的LacrosseS服务,LVS不再是系统的瓶颈。
缺点:不过,那种办法索要全部的服务器援助”IP Tunneling”(IP
Encapsulation)协议,小编仅在Linux系统上落实了那个。
2.2.3 DR
优点:和TUN一样,LVS也只是散发请求,应答包通过单独的路由方法重临给客户端。与TUN比较,DLX570那种达成方式不须求隧道结构,因而能够动用超越五成操作系统做为EnclaveS。
相差:要求LVS的网卡必须与奥迪Q3S的网卡在一个网段上
3 不一致情势的布置格局,验证格局分别是什么?
3.1 基本的条件供给
需要2台LVS和n(n>=2)台RS
3.1.1 LVS
设置ipvsadm(LVS管理工科具)和keepalived;
开启路由转载作用:
vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
验证:
sysctl -p
net.ipv4.ip_forward = 1
3.1.2 RS
设置httpd(用于最后测试)
3.2 NAT形式配置
3.2.1 环境概述
操作系统 负载均衡情势 VIP NVIP
RHEL7.4 NAT 193.168.140.80 192.168.102.165


LVS(Linux Virtual
Server):Linux虚拟服务器,那里通过keepalived作为负载均衡器
奥迪Q7S(Real Server):真实服务器
V本田UR-VPAJEROP(Virtual Router Redundancy Protocol): 虚拟路由冗余商事,
消除局域网中配置静态网关出现单点失效现象的路由协议
图片 2

D福特Explorer2的搭建基本同D途睿欧1,首要修改一下布局文件中/etc/keepalived/keepalived.conf的state和priority:state BACKUP、priority 90. 同时我们发现作为backup的DEvoque2没有启用eno16777736:0的网口:

图片 3

3.2.2 LVS
vim /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
qingean@163.com #故障接受联系人
}
notification_email_from admin@test.com #故障发送人
smtp_server 127.0.0.1 #本机发送邮件
smtp_connect_timeout 30
router_id LVS_MASTER #BACKUP上修修改改为LVS_BACKUP
}
vrrp_instance VI_1 {
state MASTER #BACKUP上修改为BACKUP
interface ens4
virtual_router_id 51 #虚拟路由标识,主从相同
priority 100 #BACKUP上改动为90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111 #主导认证密码必须一律
}
virtual_ipaddress {
193.168.140.80 #虚拟IP(VIP)
}
}
vrrp_instance LAN_GATEWAY { #概念网关
state MASTER #BACKUP上修改为BACKUP
interface ens3
virtual_router_id 62 #虚拟路由ID,主从相同
priority 100 #BACKUP上修改为90
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress { #ens3网关虚拟IP
192.168.102.165
}
}
virtual_server 192.168.102.165 80 { #概念内网网关虚拟IP和端口
delay_loop 6 #检查RS时间,单位秒
lb_algo rr
#设置负载调度算法,轮叫(rr)、加权轮叫(wrr)、最小连接(lc)、加权最小连接(wlc)、基于局部性最小连接(lblc)、带复制的依照局地性最少链接(lblcr)、指标地址散列(dh)和源地址散列(sh)
lb_kind NAT #安装LVS负载均衡NAT格局
persistence_timeout 50
#同一IP的连天60秒内被分配到均等台真正服务器(测试时建议改为0)
protocol TCP #利用TCP协议检查瑞虎S状态
real_server 192.168.102.161 80 { #首先个网关节点
weight 3 #节点权重值
TCP_CHECK { #健检方式
connect_timeout 3 #连接超时
nb_get_retry 3 #重试次数
delay_before_retry 3 #重试间隔/S
}
}
real_server 192.168.102.162 80 { #其次个网关节点
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
}
}
}
virtual_server 193.168.140.80 80{ #概念虚拟IP
delay_loop 6
lb_algo rr
lb_kind NAT
persistence_timeout 50
protocol TCP
real_server 192.168.102.163 80 { #第一个RS
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
real_server 192.168.102.164 80 { #第二个RS
weight 3
TCP_CHECK {
connect_timeout 3
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}
3.2.3 RS
为持有奥德赛S添加网关为192.168.102.165:
vim /etc/sysconfig/network-scripts/ifcfg-ens3
GATEWAY=192.168.102.165
重启; 使用route –n查看是或不是中标
IPVS connection entries
pro expire state source virtual destination
TCP 01:54 FIN_WAIT 10.167.225.60:53882 193.168.140.80:80
192.168.102.163:80
TCP 00:37 NONE 10.167.225.60:0 193.168.140.80:80 192.168.102.163:80

 

搭建DR1:

[root@DR1 ~]# yum -y install ipvsadm keepalived   #安装ipvsadm和keepalived
[root@DR1 ~]# vim /etc/keepalived/keepalived.conf   #修改keepalived.conf配置文件
    global_defs {
       notification_email {
         root@localhost
       }
       notification_email_from keepalived@localhost
       smtp_server 127.0.0.1
       smtp_connect_timeout 30
       router_id 192.168.4.116
       vrrp_skip_check_adv_addr
       vrrp_mcast_group4 224.0.0.10
    }

    vrrp_instance VIP_1 {
        state MASTER
        interface eno16777736
        virtual_router_id 1
        priority 100
        advert_int 1
        authentication {
            auth_type PASS
            auth_pass %&hhjj99
        }
        virtual_ipaddress {
          192.168.4.120/24 dev eno16777736 label eno16777736:0
        }
    }

    virtual_server 192.168.4.120 80 {
        delay_loop 6
        lb_algo rr
        lb_kind DR
        protocol TCP

        real_server 192.168.4.118 80 {
            weight 1
            HTTP_GET {
                url {
                  path /index.html
                  status_code 200
                }
                connect_timeout 3
                nb_get_retry 3
                delay_before_retry 3
            }
        }
        real_server 192.168.4.119 80 {
            weight 1
            HTTP_GET {
                url {
                  path /index.html
                  status_code 200
                }
                connect_timeout 3
                nb_get_retry 3
                delay_before_retry 3
            }
         }
    }
[root@DR1 ~]# systemctl start keepalived
[root@DR1 ~]# ifconfig
    eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.4.116  netmask 255.255.255.0  broadcast 192.168.4.255
            inet6 fe80::20c:29ff:fe93:270f  prefixlen 64  scopeid 0x20<link>
            ether 00:0c:29:93:27:0f  txqueuelen 1000  (Ethernet)
            RX packets 14604  bytes 1376647 (1.3 MiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 6722  bytes 653961 (638.6 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    eno16777736:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.4.120  netmask 255.255.255.0  broadcast 0.0.0.0
            ether 00:0c:29:93:27:0f  txqueuelen 1000  (Ethernet)
[root@DR1 ~]# ipvsadm -ln
    IP Virtual Server version 1.2.1 (size=4096)
    Prot LocalAddress:Port Scheduler Flags
      -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
    TCP  192.168.4.120:80 rr
      -> 192.168.4.118:80             Route   1      0          0         
      -> 192.168.4.119:80             Route   1      0          0

3.3 DLX570情势配置
3.3.1 环境概述
操作系统 负载均衡方式 VIP
RHEL7.4 DR 193.168.140.80

LVS1 LVS2 RS1 RS2
ens3:192.168.102.161 ens3:192.168.102.162 ens3:192.168.102.163
ens3:192.168.102.164
ens4:193.168.140.79 ens4:193.168.140.83 网关:192.168.102.165
网关:192.168.102.165

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图