server)
Config Dr GW
Tunneling
Non-arp Device/tie VIP
Server Network
Private
Lan/wan
LAN
Server number(Number of nodes)
Low 10-20
High 100
High 100
Real Server Gateway
Load Balance
OWN Router
OWN Router
Advantages
Address and Port conversions
WAN Environments Encrypt data
Highest performance
Disadvantages
Low efficiency
Tunnel support Require
LVS-NAT LVS-DR model of Load Balancing
LVS is short for Linux Virtual Server. It is a Virtual Server cluster system that can define one or more backend servers. Worker s in the INPUT kernel.
LVS Scheduling Methods: 10Static Method: only scheduling based on the algorithm itselfRr: Round RobinWrr: Weighted RR Weight Round RobinSh: source hashing supports session binding Based on ip address anti-balancingDh: destination hashing is not used much according to firewall settings
Dynamic Method: based o
example, the two realservers are both processing 500 connections at the beginning. Before the next request arrives, server1 only disconnects 10 connections, while server2 disconnects 490 servers. However, at this time, it is redirected to server1, server1.
The dynamic scheduling mode is used to calculate who should be scheduled for the next connection based on the RS's busy degree feedback (the dynamic feedback load balancing algorithm considers the server's real-time load and response, constan
master or backup to indicate that the LVS Router is a master or backup. The VRRP function of keepalived can also be used in this function.
-- Stop-daemon stop synchronization daemon-h -- help display help information other options:-t -- tcp-service-address indicates that the virtual server provides the tcp service [vip: port] or [real-server-ip: port]-u -- udp-service-address indicates that the virtual server provides the udp service [vip: port] or [real-server-ip: port]-f -- fwmark-service fw
reduced by one. When the system is implemented. We also introduce a value of 0 o'clock when the server is weighted. Indicates that the server is not available and is not scheduled.Simple algorithm: Active*256+inactive (who's small. Pick who)②WLC (Weighted least-connection scheduling): Weighted minimum connectionThe weighted minimum connection scheduling algorithm is a superset of minimum connection scheduling. Each server uses corresponding weights t
scheduling: WLC (Weighted Least Connections) "Weighted least-link scheduling" is a superset of "minimum connection scheduling", each service node can use corresponding weights to represent its processing power, and the system administrator can dynamically set the corresponding weights, the default value is 1, The weighted minimum connection schedule is proportional to the number of established connections to the service node and its weights as much a
Minimum Connection (WLC) -- Weighted Least ConnectionThe load Scheduler assigns user requests to a real server with the fewest back-end connections and the best performance;When all of the true server connections are 0, the request is forwarded to the backend in order, regardless of the weight value size, in accordance with polling.The load Scheduler records the number of connections that each real server has established, and it can also determine th
to the server group, the request is sent to the server, and when the server group has not been modified for some time, the busiest server is removed from the server group to reduce the degree of replication.(vii), destination address hashThe "Target address hash" scheduling algorithm finds the corresponding server from a statically allocated hash list, based on the requested destination IP address, as a hash key (hash key), if the server is available and not overloaded, sends the request to the
-ip:port]-F Fwmark Description is a service type that has been iptables marked-s The scheduling algorithm used with LVS after this optionThere are several options: Rr|wrr|lc|wlc|lblc|lblcr|dh|shThe default scheduling algorithm is: WLCThe continuous service time on a real server for-p [timeout]. This means that multiple requests from the same user will be processed by the same real server. This parameter is typically used for operations with dynamic re
-Connection scheduling algorithm abbreviation: wlc,weighted Least Connections, in LVS as the default policy, its specific scheduling algorithm and the meaning of the schedule is explained as follows:On the basis of the least-connected scheduling algorithm, the weighted weight is calculated as:overhead= (Activeconns*256+inactiveconnns)/weight, which is known by the formula, The greater the weight in the number of server cluster nodes, the smaller the o
load balancer has 10 scheduling algorithms, namely RR, WRR, LC, WLC, LBLC, LBLCR, dh, sh, sed, NQFor detailed LVS instructions, see PortalIn this paper, we will use LVS to realize MySQL read-write load balancing, keepalived Avoid single point of failure of nodes.Lvs+keepalived Configuring the Environment preparationlvs1:192.168.1.2lvs2:192.168.1.11MySQL server1:192.168.1.5MySQL server2:192.168.1.6vip:192.168.1.100Os:centos 6.4KeepAlive InstallationKe
source IP address hash, the request from the same IP is always sent to the first pick of the real server IP, thus realizing the conversation binding; Dh:destination Hashing, the target address hash, The request to the same destination address is always forwarded to the real server IP in the first pick, and the typical usage scenario is load balancing in the forward proxy cache scenarioDynamic scheduling algorithm: Scheduling based on current load status and scheduling algorithm of real serverLc
server on a cluster service;When defined, specify the Lvs-type, as well as the LVS scheduler;Manage Cluster Services:Ipvsadm?-a| E.-t|u|f? service-address? [-S scheduler]Ipvsadm?-d?-t|u|f service-address-A: Add-E: Modify-D: DeleteService-address:Tcp:-t? vip:portUdp:-u? vip:portFwm:-f?? MARK-S Scheduler: the default is WLC;Manage RS on the Cluster service:Ipvsadm-a|e-t|u|f service-address-r server-address [-g|i|m] [-w weight]ipvsadm-d-t|u|f service-ad
, and after the dispatcher receives the request packet, it will make a processing of the packet and change the target IP to RS IP so that the packet is on the RS.After the RS receives the packet, it restores the original packet so that the target IP is the VIP, because the VIP is configured on all RS, so it will be considered as its own.3) LVS Dr modeThis mode also requires a common IP configuration on the Distributor and all RS, which is the VIP.Unlike IP tunnel, it modifies the MAC address of
($IPVSADM).$IPVSADM-c//purge rule$IPVSADM-A-t 192.168.232.1:80-s WLC -P 3//The WLC here is an algorithm that can write RR etc;-a adds a rule that specifies whether NAT mode or IP tunnel mode, or Dr mode;-T followed by distribution IP;-S Specifies the algorithm for the external network of the device,-p specifies its timeout, 3 seconds to access the a server up, can be set 0, if set 0 cannot execute this scr
Model-m:nat model-W: Weight2. Modification:-E3. Delete:-D ipvsadm-d-t|u|f service-address-r server-address3. Managing view of Cluster services1.ipvsadm-l|l [Options]OPTIONS:-N: Digital format display--stats Statistical information--rate: Statistical rate--timeout: Shows the session timeout length for TCP, Tcpinfo, and UDP-C: Number of connection clients4. Situation counter: ipvsadm-z [-t|u|f service-address] 5. Situation rule: Ipvsadm–c 6. Save the rule:1.ipvsadm-s >/path/to/somefile2.ipvsadm-s
1.lvs Load ModeStatic: Based on algorithm only(1) RR Polling(2) WRR Weighted Polling(3) The SH source address hash, which binds a user's access session to a fixed server in a KV structure, can be considered as one of the load balancing cluster-preserving sessions.(4) DH Target Address hash, column: With DH to the proxy server load balancing, intranet host access to the Web page, the conference KV structure store User IP and website address, improve the proxy server cache hit ratio.Dynamic: Based
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.