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
scheduler allocates requests based on the actual connection of the backend real servers①.LC: Minimum Link (Least Connections)The scheduler dynamically dispatches network requests to the server with the fewest number of links established through the "least connection" scheduling algorithm. If the real server of the cluster system has similar system performance, the "Minimum connection" scheduling algorithm can be used to balance the load well.②.WLC: W
hash scheduling algorithm.In the actual application, the source address hash schedule and the target address hash schedule can be used together in the firewall cluster, they can guarantee the unique entrance of the whole system. 9, shortest expected delay (shortest expected delay scheduling) abbreviation SED based on the WLC algorithm, illustrateABC three machines weigh 123 respectively, and the number of connections is 123,name if you use the
LVS scheduling algorithm (scheduling method) A total of 10 kindsone, static method: Only according to the algorithm itself scheduling1. RR (Round Robin): Polling2. WRR (werghted Round Robin): Weighted polling3, SH (source Hashing): Source Address Hash4, DH (DH): Target Address HashIi. Dynamic Method: Based on the algorithm and the current load status of Rs1, LC (Least Connection): Minimum connectionAlgorithm: overhead=active*256+inactiveOverhead: Minimum loadActive: Active ConnectionInactive: In
of connections is +1Its connection aborted or timed out, its number of connections-1. When the server weight is 0 o'clock, it indicates that the server is unavailable and is not scheduledSimple algorithm: active*256+inactive (whichever is small)(2) WLC (Weighted least-connection scheduing): Weighted minimum connection. The weighted minimum connection scheduling algorithm is the minimum connection scheduling algorithm, and each server uses correspondi
of the peer heartbeat interfaceBcast eth1 // Nic that broadcasts heartbeat informationAuto_failback on // Default settingsNode node1.a.com // Configure the director master node, which is consistent with uname-n.Node node2.a.com // Configure the director backup node3. configure the director script# Vim/etc/init. d/ipvs#! /Bin/bash## LVS script for VS/DR#./Etc/rc. d/init. d/functionsVIP = 172.16.4.1RIP1 = 192.168.0.50RIP2 = 192.168.0.60PORT = 80Case "$1" inStart)Echo "start LVS"/Sbin/ifconfig eth
algorithm.
There are two load balancing algorithms:Weighted round robin (WRR) and Weighted least connections (WLC ),WRR uses the Weighted Round robin algorithm to allocate connections. WLC assigns the next connection to a server with fewer active connections through a certain weight value.
2) SLB ConfigurationThe configuration is divided into two parts,The first part is to use the slb serverfarm serverfarm
Public IP address.
203. x. x. B is the IP address of the domain name for Loadbance.
203. x. x. c is the first RealServer.
203. x. x. d is the second RealServer.
# Cat/etc/sysconfig/ha/lvs. cf
Serial_no = 45
Primary = 203. x. x.
Service = lvs
Rsh_command = ssh
Backup_active = 0
Backup = 0.0.0.0
Heartbeat = 1
Heartbeat_port = 539
Keepalive = 10
Deadtime = 20
Network = direct (change the Tunl mode to tunnel)
Nat_nmask = 255.255.255.255.255
Reserva
-- udp-serviceservice-address indicates that the virtual server provides udp services.[Vip: port] or [real-server-ip: port]-F -- fwmark-servicefwmark indicates the service type marked by iptables.-S -- the scheduling algorithm used by schedulerscheduler, which has the following options:Rr | wrr | lc | wlc | lblc | lblcr | dh | sh | sed | nq,The default scheduling algorithm is: wlc.-P -- persistent [timeout
connection, weighted minimum connectionOverhead= (active*256+inactive)/weight, small calculation results will be selected for next hop RS ServerDisadvantage: When the overhead is the same, the top-down poll response, the weight is small if the above the list will respond(3) Sed:shortest expection delay, shortest expected delayOverhead= (active+1) *256/weightCons: Troubleshoot WLC issues, but cannot ensure that hosts with small weights must respond(4)
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.