Linux virtual server

from Wikipedia, the free encyclopedia

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

description

Logo of the Linux Virtual Server project

Server farms consisting of several computers which requests via a computer network to receive and process, and one or more load distributors ( English load balancer ), which divide the requests to the available computer (engl. Scheduling ). Since computers can be dynamically added to and removed from this network, scalability and availability can be increased. LVS takes on the role of load balancer in such an installation.

LVS provides four strategies to split requests:

  • Round robin distribution
  • weighted round robin distribution
  • Distribution for existing connections ( English least-connection scheduling )
  • weighted distribution according to existing connections

There are also various options for the server to reply to the requesting computer. LVS implements the following techniques:

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

  • Second computer with LVS , which takes over if the first computer fails ( cold standby ). For example, the Heartbeat software from the High Availability Linux project comes into question (for “highly available Linux”, see web links).
  • Network monitoring software that detects the failure of a server and can automatically remove it from the network (and reintegrate it if necessary).

Examples

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

  • Setup of a LVS ( HTTP ) with 2 real servers
ipvsadm -A -t 192.168.0.1:80 -s rr
ipvsadm -a -t 192.168.0.1:80 -r 172.16.0.1:80 -m
ipvsadm -a -t 192.168.0.1:80 -r 172.16.0.2:80 -m

The first line adds the TCP port 80 to the LVS at the IP address 192.168.0.1 . The strategy to be used for load distribution is round robin (-s rr). The following two lines each add a real server to this virtual address (192.168.0.1:80). The forwarded packets should be masked (-m).

  • Status query of the LVS set up above
 ipvsadm -L -n
 IP Virtual Server version 1.0.8 (size=65536)
 Prot LocalAddress:Port Scheduler Flags
   -> RemoteAddress: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      4          0

literature

  • Wensong Zhang: Linux Virtual Server for Scalable Network Services . Changsha (China) 2000 (English, linuxvirtualserver.org [PDF; 235 kB ; accessed on April 16, 2009]).

Web links