The Local Node Feature

This page contains information about the Local Node feature in Linux Virtual Server.

If the local node feature is enabled, the load balancer can not only redirect the packets of the specified port to the other servers (remote nodes) to process it, but also can process the packets locally (local node). Which node is chosen depends on the scheduling algorithms. This local node feature can be used to build a virtual server of a few nodes, such as 2, 3 or 4 nodes, in which it is a resource waste if the load balancer is only used to redirect packets. It is wise to direct some packets to the local node to process.

This feature can also be used to build distributed identical servers, in which one is too busy to handle requests locally, then it can seamlessly forward requests to other serversto process them.This feature can be applied to VS/NAT, VS/TUN and VS/DR.

To make a load balancer process a service locally, you just need to add an entry in the virtual service, whose destination address is one of the load balancer's IP addresses, 127.0.0.1 is often used for this purpose.

Here is my configure example for testing virtual server via tunneling. There is only one real server and a load balancer in the cluster. The load balancer uses the VS/DR method to forward packets to the real server, and the load balancer can also process some requests for the virtual service. The configuration is as follows.

The load balancer (LVS), kernel 2.2.13

ifconfig eth0 172.26.20.111 netmask 255.255.255.0 broadcast 172.26.20.255 up
route add -net 172.26.20.0 netmask 255.255.255.0 dev eth0
ifconfig eth0:0 172.26.20.110 netmask 255.255.255.255 broadcast 172.26.20.110 up
route add -host 172.26.20.110 dev eth0:0
ipvsadm -A -t 172.26.20.110:23 -s wlc
ipvsadm -a -t 172.26.20.110:23 -r 127.0.0.1
ipvsadm -a -t 172.26.20.110:23 -r 172.26.20.112 -g

The real server 1, kernel 2.0.36

ifconfig eth0 172.26.20.112 netmask 255.255.255.0 broadcast 172.26.20.255 up
route add -net 172.26.20.0 netmask 255.255.255.0 dev eth0
ifconfig lo:0 172.26.20.110 netmask 255.255.255.255 broadcast 172.26.20.110 up
route add -host 172.26.20.110 dev lo:0

When two "telnet 172.26.20.110" commands are issued, one will appear the login prompt of the load balancer, the other will appear the login prompt of the real server.