LVS-net build operations

Construct

 

 1. Turn off all firewalls and security mechanisms

[root@localhost ~]# systemctl stop firewalld

[root@localhost ~]# iptables -F

[root@localhost ~]# setenforce 0

Second, the debugger machine installs two network cards, requiring IPs of different network segments

As shown above

Third, the debugger machine opens the routing forwarding function

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

net.ipv4.ip_forward = 1

Open: sysctl -p

Fourth, configure load distribution (debugger machine)

ipvsadm -A -t IP of the second network card: 80 -s rr

ipvsadm -a -t ip of the second network card: 80 -r web node machine ip: 80 -m -w 1

...................

Query the above configuration

ipvsadm -Ln

Five, web node service configuration

Modify the network card configuration and point the gateway to the IP of the debugger machine

Sixth, close the service occupying port 80 and install httpd

yum -y install httpd

systemctl start httpd

Seven, add the test file page

echo "server1" > /var/www/html/index.html

Eight, open the browser input

http://debugger machine ip

 

 

 

 Nine, query the load distribution status

ipvsadm -Lnc

 

Reprinted in: https://www.cnblogs.com/123456likun/p/11606788.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326472734&siteId=291194637