Directory:
1. Topology diagram
2. Build the Environment
3. LVS Server Deployment
4. Testing
1. Topology map the IP address of the LVS-DR mode is all external IP. In this example, the IP settings are all used to temporarily set the IP, the restart will be invalidated. The user requests the VIP, will be the LVS server response, assigns to the Real-server server, the real server finishes processing to return directly to the user, no longer passes through the LVS server.
2. Build the environment (System for Centon 6.4) (1), Lvs-server ip:192.168.36.101 (2), real-server1 ip:192.168.36.102 Install Web server prepare test Site content (3), real-s Erver2 ip:192.168.36.103 Install Web server prepare test Site content test machine: XP/WINDOW7/8 can, as long as you can ping 192.168.36.* 3. LVS Server Deployment (1), lvs-server configuration A. VIP settings: [[email protected]~]# ifconfig eth0:0 192.168.36.100 netmask 255.255.255.255
[[email protected]~]# Route add-host 192.168.36.100 Dev eth0:0b. Install ipvsadm[[email protected]~]# yum-y Install ipvsadm* C.LVS configuration: [[email protected]~]# ipvsadm-c[[email protected]~]# Ipvsadm-at 192.168.36.100:80-s rr[[email protected]~]# Ipvsadm-at 192.168.36.100:80-r 192.168.36.102:80-g[[email protected]~]# Ipvsadm-at 192.168.36.100:80-r 192.168.36.103:80-g[[email protected]~]# ipvsadm-l-N (2), real-server1 configuration [[email protected]~]# ifconfig lo:0 192.168.36.100 netmask 255.255.255.255[[email protected]~]# Route add-host 192.168.36.100 Dev lo:0[[email protected]~]# echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore [[email protected]~]# echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce [[email protected]~]# echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore [[email protected]~]# echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce (3), real-server2 configuration same as Real-server1. 4. Test now through the test machine, direct access to the LVS VIP http://192.168.36.100 Normal, you can access to the prepared test site. Configuring LVS uses round robin mode. The first time is access to Real-server1, after the refresh is access to Real-server2, and then after the refresh access Real-server1
LVS Load Balancer Dr Mode deployment