network segment, and for private network IP, VIP for external service ip,director, Real server Set VIP LVS Scheduling algorithm: Round call scheduling (Round Robin) (abbreviated RR), weighted round call (Weighted Round Robin) (WRR), least link (least connection) (LC), weighted least link (Weighted least Connections) (WLC) and so on (other algorithms, reference http://www.aminglinux.com/bbs/thread-7407-1-1.html) 2. Lvs/nat Configuration Three servers
the check
Keepalived's LVS configuration The LVS section is configured with "Virtual_server" as the starting mark, which consists of two parts, namely the Real_server segment and the Health detection section. Here is a sample configuration of the common options for the Virtual_server segment: Virtual_server 192.168.12.200 80 { Delay_loop 6 Lb_algo RR Lb_kind DR Persistence_timeout 50 Persistence_granularity Protocol TCP Ha_suspend VirtualHost Sorry_server Virtual_server: Set the star
theLetter3, each internal RS node gateway address, must be configured as the scheduler lb private LAN within the physical network card address。。。Omitted####################### #IPVS调度器实现了如下十种负载调度算法: LVs scheduling algorithm10 Kinds of scheduling algorithmsFixed scheduling algorithm: Rr,wrr,dh,shDynamic scheduling algorithm: Wlc,lc,lblc,lblcr,sed,nq.Three most commonly used RR WRR WLC10 scheduling algorithms are shown in the following table:RR: Pollin
also use the vrrp feature of keepalived.-- Stop-daemon: Stop synchronization daemon-H -- help: displays 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 fwmark indicates the service type marked by iptables. -S -- scheduler SchedulingAlgorith
-d Delete Virtual Service--clear-c Clear the whole table--restore-r Restore rules from stdin--save-s Save rules to stdout--add-server-a add real server with options--EDIT-SERVER-E edit Real Server with options--delete-server-d Delete Real Server--list-l|-l List the table--zero-z Zero counters in a service or all services--set TCP tcpfin UDP set connection timeout values--start-daemon Start Connection Sync daemon--stop-daemon Stop Connection Sync daemon--help-h Display this Help messageOptions:--
order of distribution, such as a weight of 2, gives the server 2 access requests, and then sends the access request to the step-down server.
Source Address hash (source Hashing) : Sh. A hash table is recorded with the source address of the access and the address of the server being distributed, and LVS sends the request to the corresponding server when the source address is accessed after the connection is disconnected, because it affects the equalization effect very rarely.
Destination
, Configuration keepalivedVi/etc/keepalived/keepalived.confInputDelete all content and enter the following in Lvs-master:! Configuration File for Keepalivedglobal_defs {notification_email {[email protected]} Notification_email_from [Email protected] smtp_server smtp.163.com # smtp_connect_timeout router_id lvs_devel}# vip1vrrp_instance VI_1 { State MASTER #备份服务器上将MASTER改为BACKUP interface eth0 lvs_sync_daemon_inteface eth0 virtual_router_id On the Priority 100 # Backup service, change 100
: WLC,LC,LBLC,LBLCR
Algorithm
Description
Rr
Polling algorithm, which assigns the request to a different RS node, that is, an equally distributed distribution in the RS node. This algorithm is simple, but only suitable for the RS node processing performance is similar to the situation
Wrr
Weighted rotation dispatch, which assigns tasks according to the weights of different Rs. RS with higher wei
request as the hash key. If the server is available and not overloaded, send the request to the server; otherwise, null is returned.
Source hashing)
-Find the corresponding server from the static allocated hash list based on the requested source IP address as the hash key. If the server is available and not overloaded, send the request to the server; otherwise, null is returned.
Shortest expected delay scheduling SED)
-Wlc-based algorithm
-Weights of
install it on the Load balancer and forward requests sent to the virtual IP address to the Real Server. Install On the Director server, that is, the 10.11.100.97 server. Installation Process: Tar zxvf ipvsadm-1.24.tar.gzcd ipvsadm-1.24makemake install configuration ipvs: Edit: LVS-Dr # Under/etc/init. d/directory #! /Bin/bash # LVS vs-Dr server (ipvsadm) # chkconfig:-345 55 25 # Description: ipvsadm # case "$1" in start) echo "1">/proc/sys/NET/IPv4/CONF/eth0/send_redirects echo "1">/proc/sys/NE
scheduled.Simple Algorithm: active X 256 + inactive (who is small, who is chosen)
② Wlc (Weighted Least-Connection Scheduling): Weighted Least join The weighted least-connection scheduling algorithm is a superset of least-connection scheduling. Each server uses the corresponding weights to indicate its processing performance. The default server weight is 1, and the system administrator can dynamically set server permissions. The weighted least connec
192.168.0.3 80-p 2/usr/sbin/ipmasqadm-A-t 10.44.110.209: 80-s wlc # Weighted Least-Connection scheduling mode/usr/sbin/ipmasqadm-A-t 10.44.110.209: 21-s wrr # Weighted Round Robing scheduling mode
Table 1 shows the work to be done by IPVS. The virtual server itself does not have server software installed and cannot provide the corresponding service content, but it can send all TCP-based Web requests (port 80) that access 10.44.110.209) it is forwar
Lvs dr mode installation
Environment: centos5.5 Note: The test environment is centos5.5, and three centos systems are virtualized on the virtual machine)
Vip 192.168.3.169
Lb is ip192.168.3.168
Server1 ip: 192.168.10.2
Server1 ip: 192.168.10.3
Install ipvsadmin In the rpm package
I lb configuration above
1 copy Nic ifcfg-eth0: 1
DEVICE = eth0: 1
BOOTPROTO = none
IPADDR = 192.168.3.169
NETMASK = 255.255.0.0
ONBOOT = yes
2. Enable the routing forwarding function vim/etc/sysctl. conf
Net. ipv4.ip _
scheduling.
Wlc: weight least connection overhead = (Active * 256 + inactive)/weight
Sed: Shortest Route CT delay overhead = (Active + 1) * 256/weight
NQ: nerver queue
Lblc: locality-based least connection DH + Lc
Lblcr: replicated and locality-based least connection
Session persistence Mechanism
Session binding: always directs the connection of the same requestor to the same RS (the scheduling method is still selected for the first request).
real server to a virtual server-E (--edit-server) edit a real server record in a virtual server record-D (--delete-server) deletes a real server record in a virtual server record-l|-l–list displaying a list of virtual servers in the kernel-Z (--zero) Virtual Server list counter clear 0 (empty the current number of connections, etc.)--set TCP tcpfin UDP setting Connection timeout value-T describes the TCP service provided by the virtual server, which is followed by the following format:[Virtual-
server record in a virtual server record-D (--delete-server) deletes a real server record in a virtual server record-l|-l–list displaying a list of virtual servers in the kernel-Z (--zero) Virtual Server list counter clear 0 (empty the current number of connections, etc.)--set TCP tcpfin UDP setting Connection timeout value-T describes the TCP service provided by the virtual server, which is followed by the following format:[Virtual-service-address:port] or [Real-server-ip:port]-U indicates tha
Distributor and all RS, which is the VIPUnlike IP tunnel, it modifies the MAC address of the packet to the MAC address of the RS.When 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 consider itselfThe scheduling algorithm of LVSPoll Round-robin RR? Weighted polling Weight Round-robin WRR? Minimum connection Least-connection LC? weighted minimum connection Weight least-connection
corresponding server in the statically allocated hash table, and if the server does not exceed the load , assign the request to the server1.1.4 dh (Destination hashing)Destination Address Hash,the sameIpaddress of the request,Sent to the sameServerThe target address hash scheduling algorithm is a static mapping algorithm based on the load balance of the target IP address, and the target IP address is used as the key word in the statically assigned The corresponding server is found in the hash t
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.