Using LVS-NAT + ipvsadm to implement the service cluster on RHEL5.7 is as follows: Note: the cluster configuration is implemented in vmwarevirtual machine, is to load balancing cluster for web Services. In actual work, the webpage data of the web Services of reserver1 and realserver2 are exactly the same. In this article, we intentionally set them to different webpages to highlight the experiment results. Please note that in actual work, make sure to make the web pages of realserver1 and realserver2
UseLVS-NAT + ipvsadmImplementationRHEL 1, 5.7Service Cluster on
As follows:
650) this. width = 650; "border = 0>
Note:
The cluster configuration in this article is inVMwareIn virtual machinesWebServer Load balancer cluster.
In actual work,Reserver1AndRealserver2OfWebThe webpage data of the service is exactly the same. In this article, we intentionally set different webpages to highlight the experiment results. Please note that in actual work, make sure thatRealserver1AndRealserver2.
Three VMS are required.LinuxHost, respectively namedDirector,RS1,RS2
WhereDirector:
Eth0: 172.16.22.1Select bridging as the NIC
Eth1: 192.168.22.1Select as host only
RS1:
Eth0: 192.168.22.22Select as host only
RS2:
Eth0: 192.168.22.23Select as host only
EnsureWindowsFirewall and three virtual machines in the Virtual MachineLinuxThe firewall of the host is completely disabled.
Specific implementation process:
1.InDirectorHost:
Check whether the kernel is supportedIpvsAnd Installation DefinitionIpvsRule tool:Ipvsadm
- # Ifconfig eth0 172.16.22.1 255.255.0.0
- # Ifconfig eth1 192.168.22.1 255.255.255.0
- # Grep-I "vs"/boot/config-2.8.18-164.e15
- # Yum install ipvsadm-y
- # Vim/etc/selinux/config
- # Setenforce 0
- # Cat/proc/sys/net/ipv4/ip_forward # Check whether Forwarding is enabled
- # Sysctl-wNet. ipv4.ip_forward=1
2.InRS1Host:
- # Ifconfig eth0 192.168.22.22 255.255.255.0
- # Route add default gw 192.168.22.1
- # Ping 192.168.22.1
- # Setenforce 0
- # Rpm-ivh httpd-2.2.3-31.el5.i386.rpm
- # Echo
- "Success">/Var/www/html/index.html
- # Service httpd start
- # Elinks-dump http: // 192.168.22.22 # test whether the local machine can access the web Service
650) this. width = 650; "border = 0>
Note: The local machine can be accessed normally at this time.WebService.
3.InRS2Host:
- # Ifconfig eth0 192.168.22.22 255.255.255.0
- # Route add default gw 192.168.22.1
- # Ping 192.168.22.1
- # Setenforce 0
- # Rpm-ivh httpd-2.2.3-31.el5.i386.rpm
- # Echo "success">/Var/www/html/index.html
- # Service httpd start
- # Elinks-dump http: // 192.168.22.23 # test whether the local machine can access the web Service
650) this. width = 650; "border = 0>
Note: The local machine can be accessed normally at this time.WebService.