Linux Virtual Server

Linux Virtual Server (LVS ) is a software for load balancing. It extends the Linux kernel to methods for transparent allocation of requests from the network to multiple servers. The allows the realization of high-availability server farms with free software.

Description

Server farms consist of multiple machines, receive and process the requests via a computer network, and one or more load balancers (English load balancer ), which divide the requests to the available computer ( engl. scheduling ). Since computers can be dynamically added and removed to this network, so scalability and availability can be increased. LVS takes over the role of load sharing in such an installation.

LVS provides four strategies available to route requests:

  • Round -robin distribution
  • Weighted round-robin distribution
  • Distribution for existing connections ( engl. least -connection scheduling )
  • Weighted distribution for existing connections

For the response of the server to the requesting computer, there are also several ways. LVS implements the following techniques:

  • LVS / NAT (corresponds to " NAT based SLB " )
  • LVS / TUN
  • LVS / DR (equivalent to "Flat based SLB " )

With additional components are required for a high-availability installation, for which there is also free software projects.

  • Second host with LVS, the jump in case of failure of the first computer ( engl. cold standby). Questioning comes, for example, the software heartbeat of the "High Availability Linux " project (English for, highly available Linux ', see Related links).
  • Network monitoring software that detects the failure of a server and it will automatically be removed from the composite (and possibly re- integrate ) can.

Examples

Administrative tool for configuring LVS is ipvsadm. This can only be used with the root account.

  • Establishment of an LVS (HTTP) with two real servers

Ipvsadm -A -t 192.168.0.1:80 -s rr ipvsadm -a-t 192.168.0.1:80 -r - m 172.16.0.1:80 ipvsadm -a-t 192.168.0.1:80 -r - m 172.16.0.2:80 First line adds to the IP address 192.168.0.1 on TCP port 80 added to the LVS. Applicable strategy of load distribution is in this case round-robin ( -s rr ). The following two lines add each add a real server this virtual address ( 192.168.0.1:80 ). Here, the forwarded packets should be masked (-m).

  • Status check of the above- furnished LVS

Ipvsadm -L -n IP Virtual Server version 1.0.8 ( size = 65536) Prot Local Address: Port Scheduler Flags    -> Remote Address: Port Forward Weight activeconn InActConn TCP 192.168.0.1:80 rr    -> 172.16.0.2:80 Masq 1 3 1    -> 172.16.0.1:80 Masq 1 0 4 swell

416591
de