LVS clusters are commonly used in three modes, LVS-DR is the most commonly used one, but sometimes LVS-NAT mode is also used; this experiment is configured for NAT Mode
Server Load balancer only, high availability is not configured
Three servers:
Director server:
Eth0: 192.168.70.135
Eth1: 192.168.132.130
Real server1: eth0: 192.168.132.128
Real server2: eth0: 192.168.132.129
1. Configure Realserver1
[Root @ zhu4 ~] # Nl/var/www/jiang/zhu.html 1
2. Configure Realserver2
[root@zhu3 ~]# nl /var/www/jiang/zhu.html1
3. Configure Director server
[root@zhu2 ~]# ifconfig eth0:0 192.168.70.99[root@zhu2 ~]# ipvsadm -A -t 192.168.70.99:80 -s rr[root@zhu2 ~]# ipvsadm -a -t 192.168.70.99:80 -r 192.168.132.128 -m[root@zhu2 ~]# ipvsadm -a -t 192.168.70.99:80 -r 192.168.132.129 -m[root@zhu2 ~]# ipvsadm -L -nIP Virtual Server version 1.2.1 (size=4096)Prot LocalAddress:Port Scheduler Flags-> RemoteAddress:Port Forward Weight ActiveConn InActConnTCP 192.168.70.99:80 rr-> 192.168.132.129:80 Masq 1 0 0-> 192.168.132.128:80 Masq 1 0 0
4. Access test:
650) this. width = 650; "title =" 2013-09-11_161_2.jpg "src =" http://www.bkjia.com/uploads/allimg/131228/061KJ1L-0.jpg "width =" 614 "height =" 123 "/>
650) this. width = 650; "style =" width: 684px; height: 111px "title =" 2013-09-11_164552.jpg "src =" http://www.bkjia.com/uploads/allimg/131228/061KM127-1.jpg "width =" 681 "height =" 81 "/>
Load Balancing completed