This experiment is to realize the environment under the lvs-dr premiseTest environment
hostname
eth0 DR1
192.168.137.100
DR2
192.168.137.101
rs1
Span style= "font-family: ' The song body '; font-size:14px;" >192.168.137.111
rs2
192.168.137.122
Preparatory work:1,ipvsadm-c setenforce 0 iptables –F2.VIP address take 192.168.137.88 as an example3,DR1 and DR2 ne
the main dir before the installation configuration, it is only required to configure the Dir1.[email protected] ~]# Yum install-y ipvsadm3. ConfigurationConfigure on the main Dr[[email protected] ~]# echo "" >/etc/keepalived/keepalived.conf//empty default configuration First[[email protected] ~]# vim/etc/keepalived/keepalived.conf//Add the following:Vrrp_instance Vi_1 {State MASTER #如果是备用服务器, change this to BACKUPInterface eth0VIRTUAL_ROUTER_ID 51Priority #如果是备用服务器, change here to 90 (less than
1. Software IntroductionLVS is a shorthand for Linux virtual server, that is, a virtual servers cluster system, which can realize simple load balancing under the Linux platform.LVS Load Balancer has 4 load balancing methodsA.dr modeB.nat modeC.tunnel modeD.full NAT Mode8 Scheduling algorithms of LVS load Balancing(RR,WRR,LC,WLC,LBLC,LBLCR,DH,SH)The principle of each mode is not described here, this paper uses the DR Mode, RR scheduling algorithm.Keepa
effectAs the volume of your website grows, the pressure on your site's servers is increasing. Requires a load balancing scheme! Commercial hardware such as F5 and too expensive, you are the entrepreneurial interconnection company how to effectively save costs, saving unnecessary waste? The same high-performance, high-availability features that enable commercial hardware? What good load balancing can be done to extend the scalable solution? The answer is YES! Yes! We use Lvs+keepalived's archite
, LVS will automatically distinguish, so the overall system is very stable.4, no flow, the above has been mentioned. LVS simply distributes the request, and the traffic does not go out of it itself, so it can be used to do some line diversion. Without traffic, the IO performance of the Equalizer will not be affected by large traffic.5, basically can support all applications, because LVS work in the 4 layer, so it can load balance almost all applications, including HTTP, database, chat room and s
, Real server is setVipLVS Scheduling algorithm: Round call scheduling (Round Robin) (abbreviated RR), weighted round call (Weighted RoundRobin) (WRR), Minimum link (least connection) (LC), weighted least link (Weighted leastConnections) (WLC), etc.LVS/DR Mode configurationThree servers one as director, two as real server (Vi/etc/sysconfig/network to host name)Dir eth0 192.168.239.140 vip eth0:0: 192.168.239.110Real1 eth0 192.168.239.141 vip lo: 0:192
work in the 4 layer, so it can load balance almost all applications, including HTTP, database, chat room and so on.Another: LVS is not fully able to identify node failures, for example, in the WLC allocation mode,ClusterThere is a node not configured VIP, will make the whole cluster can not be used, when using WRR allocation method will lose a machine. The problem is still being tested further. Therefore, the use of LVS also have to be more careful t
}virtual_ipaddress {10.72.4.100}}Virtual_server 10.72.4.100 80 {Delay_loop 6 # (query Realserver status every 10 seconds)Lb_algo WLC # (LVS algorithm)Lb_kind DR # (Direct Route)Persistence_timeout 60 # (connection of the same IP is assigned to the same realserver within 60 seconds)Protocol TCP # (check realserver status with TCP protocol)real_server 10.72.4.37 {Weight 100 # (weight)Tcp_check {Connect_timeout 10 # (10 seconds No response timeout)Nb_get
Ipvsadm is actually a rule-generating tool like iptables, working on the input chain of the iptables.First,ipvsadm installation, automatic start1. See if kernel compilation supports IpvsGrep-i ipvs/boot/config-2.6.32-431.el6.x86_642. Installing IpvsadmYum Install Ipvsadm-y3. Check if the service starts automaticallyChkconfig--list Ipvsadm See if Ipvsadm service starts automaticallyChkconfig--level 3 on Let Ipvsadm automatically start at 3 levels each time you bootSecond, Ipvsadm Basic command1.
First analyze what causes the load to be uneven:1, the LVS own Exchange session hold (PERSISTENT10) may cause the load uneven;2, scheduling algorithm settings may be caused, such as RR, WRR, WLC, LC algorithm;3, the back end of the RS node to maintain parameters, such as the keepalive parameters of Apache;4, the situation of less traffic, the phenomenon of imbalance is more obvious;5, the user sends the request time length and the resources how much s
connections will be requested first, and this algorithm can be selected when the server performance is basically consistent.L weighted minimum number of connections (WLC): The load scheduler can automatically adjust server weights when server node performance varies greatly. Servers with higher weights will be responsible for large customer requests.4. Three modes of load balancing? Address translation: referred to as NAT mode. is the load scheduler
distribution request, and the response packet is returned directly to the customer by RS, reducing the load balancer's massive data flow, and the load balancer is no longer a system bottleneckDisadvantage: Each machine needs a public IP, * Tunnel-tun: principle: (one IP packet is encapsulated in another IP packet, so it can cross the network segment.) After the DR receives the request packet, according to the scheduling algorithm to find the corresponding Rs,rs received, the message is unpacke
about the equalizer itself will be what problems, node failure, LVS will automatically distinguish, so the overall system is very stable.4, no flow, the above has been mentioned. LVS simply distributes the request, and the traffic does not go out of it itself, so it can be used to do some line diversion. Without traffic, the IO performance of the Equalizer will not be affected by large traffic.5, basically can support all applications, because LVS work in the 4 layer, so it can load balance alm
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.