LVS-NAT + ipvsadm implement service cluster on RHEL5.7

Source: Internet
Author: User
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

 
  1. # Ifconfig eth0 172.16.22.1 255.255.0.0
  2. # Ifconfig eth1 192.168.22.1 255.255.255.0
  3. # Grep-I "vs"/boot/config-2.8.18-164.e15
  4. # Yum install ipvsadm-y
  5. # Vim/etc/selinux/config
  6. # Setenforce 0
  7. # Cat/proc/sys/net/ipv4/ip_forward # Check whether Forwarding is enabled
  8. # Sysctl-wNet. ipv4.ip_forward=1 

2.InRS1Host:

 
  1. # Ifconfig eth0 192.168.22.22 255.255.255.0
  2. # Route add default gw 192.168.22.1
  3. # Ping 192.168.22.1
  4. # Setenforce 0
  5. # Rpm-ivh httpd-2.2.3-31.el5.i386.rpm
  6. # Echo
  7. "Success">/Var/www/html/index.html
  8. # Service httpd start
  9. # 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:

 
  1. # Ifconfig eth0 192.168.22.22 255.255.255.0
  2. # Route add default gw 192.168.22.1
  3. # Ping 192.168.22.1
  4. # Setenforce 0
  5. # Rpm-ivh httpd-2.2.3-31.el5.i386.rpm
  6. # Echo "success">/Var/www/html/index.html
  7. # Service httpd start
  8. # 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.