LVS-NAT :( Linux virtual server) platform: VMwareACEEdition (Version: 6.05) IMGAGE: RedHatEnterpriseLinux5 --------------------------------------------------- LVS-NAT: (Linux virtual server)
Platform: VMware ACE Edition (Version: 6.05)
IMGAGE: Red Hat Enterprise Linux 5
------------------------------------------------------------------
DIRECTOR:
VIP: 192.160.0.40 // eth0: 0
DIP: 172.16.10.10
REALSERVER:
RSever1 vip: 192.168.0.40 // lo: 0
RSever2 vip
:
192.168.0.40 // lo: 0
The architecture is as follows:
------------------------------------------------------------------
- Director: yum install ipvsadm
- RServer1: yum install mysql-server php-SQL php-mbsring
- RServer2: yum install mysql-server php-SQL php-mbsring
- RServer1: vim/var/www/html/index RealServer TestPage1
- RServer1: vim/var/www/html/index RealServer TestPage2
- Service httpd start
- Director: cat/proc/sys/net/ipv4/ip_forward
- Echo1>! $// Enable the ICMP forwarding function
- Director: ipvsadm-A-t192.168.0.40-S rr
- Ipvsadm-L-n
- Director: ipvsadm-a-t192.168.0.40:80-R172.16.10.11-M
- Ipvsadm-a-t192.168.0.40:80-R172.16.10.12-M
Test:
========================================================== ========================================================== ==========
LVS-DR:
DR Model
1. All bridges are connected to a vswitch.
2. In order to avoid interference from the VIP's response to the host, we set the VIP address on the REALSERVER's LOOP interface on the REALSERVER.
The source address is always the best IP address, so the IP address from the REALSERVER is the LOOP interface VIP, which adds a host route based on the response.
Director:
RIP needs to be configured on the interface, and VIP needs to be configured on the LO alias.
1. Configure VIP
# Ifconfig lo: 0 $ vip broadcast $ vip netmask 255.255.255.255
# Route add-host $ vip dev eth0: 0
Echo 1>/proc/sys/net/ipv4/ip_forward
2. Define the cluster service // last congure
REALSERVER:
RIP needs to be configured on the interface, and VIP needs to be configured on the LO alias:
1. Define kernel parameters to prohibit responses to ARP broadcast requests to VIP addresses:
Echo 1>/proc/sys/net/ipv4/conf/lo/arp_igonre
Echo 2>/proc/sys/net/ipv4/conf/lo/arp_announce
Echo 1>/proc/sys/net/ipv4/conf/all/arp_igonre
Echo 2>/proc/sys/net/ipv4/conf/all/arp_announce
2. Configure VIP
# Ifconfig lo $ VIP broadcast $ VIP netmask 255.255.255.255 up
# Route ad-host $ VIP dev lo: 0
3. Configure the startup service as a cluster service