部署LVS DR集群

2022-06-17 05:42:11 字數 2256 閱讀 4969

設定proxy**伺服器的vip和dip

[root@proxy ~]# cd /etc/sysconfig/network-scripts

[root@proxy network-scripts]# cp ifcfg-eth0

[root@proxy network-scripts]# vim ifcfg-eth0:0

type=ethernet

bootproto=none

defroute=yes

name=eth0:0

device=eth0:0

onboot=yes

ipaddr=192.168.4.15

prefix=24

[root@proxy network-scripts]# service network restart

設定web1伺服器網路引數

[root@web1 ~]# nmcli connection modify eth0 ipv4.method manual \

ipv4.addresses

192.168.4.100/24

connection.autoconnect yes

[root@web1 ~]# nmcli connection up eth0

[root@web1 ~]# cd /etc/sysconfig/network-scripts/[root@web1 ~]# cp ifcfg-lo

[root@web1 ~]# vim ifcfg-lo:0

device=lo:0

ipaddr=192.168.4.15

netmask=255.255.255.255

network=192.168.4.15

broadcast=192.168.4.15

onboot=yes

name=lo:0

[root@web1 ~]# vim /etc/sysctl.conf

#手動寫入如下4行內容

net.ipv4.conf.all.arp_ignore = 1

net.ipv4.conf.lo.arp_ignore = 1

net.ipv4.conf.lo.arp_announce = 2

net.ipv4.conf.all.arp_announce = 2

#當有arp廣播問誰是192.

168.4

.15時,本機忽略該arp廣播,不做任何回應

#本機不要向外宣告自己的lo回環位址是192.

168.4.15

[root@web1 ~]# sysctl -p

設定web2伺服器網路引數

[root@web2 ~]# nmcli connection modify eth0 ipv4.method manual \

ipv4.addresses

192.168.4.200/24

connection.autoconnect yes

[root@web2 ~]# nmcli connection up eth0

[root@web2 ~]# cd /etc/sysconfig/network-scripts/[root@web2 ~]# cp ifcfg-lo

[root@web2 ~]# vim ifcfg-lo:0

device=lo:0

ipaddr=192.168.4.15

netmask=255.255.255.255

network=192.168.4.15

broadcast=192.168.4.15

onboot=yes

name=lo:0

[root@web2 ~]# vim /etc/sysctl.conf

#手動寫入如下4行內容

net.ipv4.conf.all.arp_ignore = 1

net.ipv4.conf.lo.arp_ignore = 1

net.ipv4.conf.lo.arp_announce = 2

net.ipv4.conf.all.arp_announce = 2

#當有arp廣播問誰是192.

168.4

.15時,本機忽略該arp廣播,不做任何回應

#本機不要向外宣告自己的lo回環位址是192.

168.4.15

[root@web2 ~]# sysctl -p

[root@web2 ~]# systemctl restart network

部署LVS DR群集

ipvsadm c 清空現有策略 root www ipvsadm a t 192.168.137.254 80 s rr root www ipvsadm a t 192.168.137.254 80 r 192.168.137.130 80 g w 1 root www ipvsadm a t ...

LVS,DR模式 Keepalived部署

配置資訊 lvs master 10.0.0.41 centos7 lvs backup 10.0.0.42 centos7 lvs dr vip 10.0.0.100 web1 10.0.0.43 centos7 web2 10.0.0.44 centos7 1.分別在lvs master和lvs...

CentOS上配置LVS DR集群

centos上配置lvs dr集群 3臺集群伺服器作業系統 centos 5.5 x86 1臺客戶端作業系統 windows 2008 x64 lvs集群使用dr模式,1個ds director server 2個rs real server 路由只有乙個,routea routeb。上圖中的gw為...