标签:net 服务 tables install 实验 ble mask stop UNC
准备多台服务器,现以三台服务器为例
第一台做调度器 192.168.200.111
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# yum -y install ipvsadm net-tools
[root@localhost ~]# ifconfig ens32:0 192.168.200.254 netmask 255.255.255.0
[root@localhost ~]# ipvsadm -A -t 192.168.200.254:80 -s rr
[root@localhost ~]# ipvsadm -a -t 192.168.200.254:80 -r 192.168.200.112:80 -g -w 1
[root@localhost ~]# ipvsadm -a -t 192.168.200.254:80 -r 192.168.200.113:80 -g -w 1
第二台做节点服务器 192.168.200.112
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# yum -y install httpd net-tools
[root@localhost ~]# ifconfig lo:0 192.168.200.254 netmask 255.255.255.255
[root@localhost ~]# route add -host 192.168.200.254 dev lo:0
[root@localhost ~]# echo 11111 > /var/www/html/index.html
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# vim /etc/sysctl.conf
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.default.arp_ignore = 1
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
[root@localhost ~]# sysctl -p
第二台做节点服务器 192.168.200.113
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# yum -y install httpd net-tools
[root@localhost ~]# ifconfig lo:0 192.168.200.254 netmask 255.255.255.255
[root@localhost ~]# route add -host 192.168.200.254 dev lo:0
[root@localhost ~]# echo 22222 > /var/www/html/index.html
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# vim /etc/sysctl.conf
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.default.arp_ignore = 1
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
[root@localhost ~]# sysctl -p
标签:net 服务 tables install 实验 ble mask stop UNC
原文地址:https://www.cnblogs.com/lyqlyqlyq/p/11641875.html