LVS集群

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 同上

posted @ 2019-10-09 15:00  有无  阅读(85)  评论(0编辑  收藏  举报

博客记录了我学习linux过程中的一些问题及解决方法,内容可能仅适用于个人,如带来不便,望请见谅!