I. Introduction to LVS (Linux Virtual Server):
background: With the rapid development of Internet, the requirements of network broadband and server are more and more high. As a result, the need for high-availability scalable, high-availability network services with hardware and software approaches is growing. Requirements for highly available scalable, highly available network services Dr. Zhangwensong established the LVS Free software project in May 1988, which is based on the IP layer and the load balancing scheduling method based on content request distribution, and implements these methods in the Linux kernel to form a set of servers to achieve a scalable, Virtual server for highly available network services.
Project Objective: using cluster technology and Linux operating system to achieve a high-performance, high-availability server, it has good scalability, reliability and manageability.
ii. LVS (Linux Virtual Server) Architecture:
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "border=" 0 "style=" Background:url ("/e/u261/ Lang/zh-cn/images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "spacer.gif"/> 650) this.width= 650; "Src=" http://s5.51cto.com/wyfs02/M00/7F/D4/wKiom1cu6y3io8y2AAB6Srku99g230.jpg "title=" Lvs-architecture.jpg " alt= "Wkiom1cu6y3io8y2aab6srku99g230.jpg"/>
(this image is from the network)
load Balancer: is the entire cluster external front end machine, consisting of one or more load schedulers (Director server), responsible for distributing customer requests to server cluster servers, The customer considers the service to be from an IP address (virtual IP address). The scheduler is the only entry point of the server cluster system, which can be combined with IP load balancing technology, content-based request distribution technology, or both. All of its operations are done in the kernel of the Linux operating system, with minimal overhead and high throughput rates.
Server Cluster: is made up of multiple real servers that are connected by a high-speed LAN or a geographically dispersed wan, and the number of server pools is variable. When the load exceeds the processing power of all current servers, you can add servers to the server pool to increase processing power to resolve this issue.
Storage: provides shared storage for all real servers, allowing the server to have the same content and provide the same services.
Third, the LVS (Linux Virtual Server) kernel model:
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7F/D2/wKioL1cu7N3gLTmnAABur1Hvpmk534.png "title=" image 1 1. PNG "alt=" Wkiol1cu7n3gltmnaabur1hvpmk534.png "/>
1, when the client's request arrives at the load scheduler, first arrives at the prerouting chain;
2. When the destination address of the request packet is local, the packet is sent to the input chain through the prerouting chain;
3, when the packet reaches the input chain, IPVS will check the packet, the destination address of the packet and the port is not within the rules, the packet is sent to the user space;
4. If the destination address and port of the packet are within the rule, the destination address of the packet is modified to the address of a selected server in real server, and the packet is sent to the postrouting chain;
5. The packet is sent through the postrouting chain to the selected server in real server.
Note:ipvsadm: A command-line tool for user space to manage the Cluster service and real server on the Cluster service;
Ipvs: Program code that works on the input chain on the kernel, and its cluster functionality relies on the cluster server rules defined by IPVSADM.
Iv. Types of LVS (Linux Virtual Server) :
1. Vs/nat Technology (Virtual Server via Network Address translation):
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7F/D4/wKiom1cu8q6R30sJAACnqA4h99s820.jpg "title=" Vs-nat.jpg "alt=" Wkiom1cu8q6r30sjaacnqa4h99s820.jpg "/>
(This image is from the network)
2.vs/dr (Virtual Server via Direct Routing):
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7F/D2/wKioL1cu8_HQkjYuAACzH2kj6gw326.jpg "title=" Vs-dr.jpg "alt=" Wkiol1cu8_hqkjyuaaczh2kj6gw326.jpg "/>
(This image is from the network)
3.Vs/tun (Virtual Server via IP tunneling):
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7F/D2/wKioL1cu9H7gwEApAAC0kcML3jE463.jpg "title=" Vs-tun.jpg "alt=" Wkiol1cu9h7gweapaac0kcml3je463.jpg "/>
(This image is from the network)
This article is from the "11281941" blog, please be sure to keep this source http://11291941.blog.51cto.com/11281941/1771217
LVS cluster detailed (continuous update)