, 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
Router is master or backup. You can also use keepalived in this function.VRRP function.--stop-daemon Stop the synchronization daemon-H--help Display Help information
Other options:
-T--tcp-service service-address indicates that the virtual server provides TCP services[Vip:port] or [Real-server-ip:port]-U--udp-service service-address indicates that the virtual server provides UDP services[Vip:port] or [Real-server-ip:port]-F--fwmark-service fwmark description is a service type that has been ip
1998 by Dr. Zhangwensong, this project is one of the earliest free software projects in China. LVS is mainly used for multi-server load balancing for the network layer. In a server cluster system built by LVS, the load balancing layer of the front end is called the director server, and the server group layer that serves the backend is called real server. Get an overview of the LVS infrastructure.LVS has three modes of operation, namely Dr (direct Routing), TUN (tunneling IP Tunneling), NAT (net
because all request packages and reply packets require the Director Server to parse and regenerate, affecting efficiency. At the same time, LVS 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 prep
)/weight3、SED:Shortest Expection Delay overload=(active+1)*256/weight4、NQ:Never Queue5、LBLC:Locality-Based LC6、LBLCR:
An alternative explanation
I'm going to start again, the scheduling algorithm is like working in a factory.After a batch of live, then there are a group of people, then how to assign live to these workers, live is the client's request, a batch of workers is the server RS, the allocation of how to work is the VS scheduler. The boss rejoined the staff, there are 4
As far as my habits are concerned, I am not too accustomed to programming with an IDE. There are two reasons: first, the computer is slow, and programming requires you to wait for half a day to open the IDE; second, it is easy to become lazy with IDE, and wait for a while after entering the name of an object, IDE will automatically list a large number of objects, such as methods and interfaces. You only need to press a direction key to select and seldom check documents, it takes a long time to m
.
Registered successfully
2 login http://post.usts.edu.cn/igenus/login.php
Keep it after logon. Do not close the email window.
3. login https://signup.live.com/signup.aspx? Ru = https % 3a % 2f % 2faccount.live.com % 2 fsummarypage lic = 1
Click your own email address to use the eud account you just applied.
Then fill in the relevant information. I fill in all the information. The region is selected from the United States and the zip code is from New York.
After successful registration, lo
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.