LVS集群

喜你入骨 提交于 2019-11-30 21:54:53

LVS服务器:192.168.200.111
[root@real ~]# iptables -F
[root@real ~]# systemctl stop firewalld
[root@real ~]# setenforce 0
[root@director ~]# yum -y install ipvsadm
[root@director ~]# ipvsadm -A -t 172.16.1.1:80 -s rr
[root@director ~]# ipvsadm -a -t 172.16.1.1:80 -r 192.168.200.112:80 -m -w 1
[root@director ~]# ipvsadm -a -t 172.16.1.1:80 -r 192.168.200.113:80 -m -w 1
[root@lvs ~]# ip a //配置两块网卡
ens32 inet 192.168.200.111/24
ens35 inet 172.16.1.1/24
[root@lvs ~]#echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf


real服务器:192.168.200.112
[root@real ~]# iptables -F
[root@real ~]# systemctl stop firewalld
[root@real ~]# setenforce 0
[root@real ~]# vim /etc/sysconfig/network-scrippts/ifcfg-ens32
将网关改为192.168.200.111
[root@real ~]# systemctl start network
[root@real ~]# yum -y install httpd
[root@real ~]# echo 111111 > /var/www/html/index.html
[root@real ~]# systemctl start httpd

real服务器 192.168.200.113 同上

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!