Set up a server cluster based on Linux (2.6 kernel)

  
                  

What is a cluster?

A cluster is a group of independent computer systems that form a loosely coupled multiprocessor system that communicates between processes over a network. Applications can distribute messages over network shared memory for distributed computers. Clusters work in a similar way to people working together.

The Vs-nat cluster is one of the simplest clusters. His structure is similar to a Linux transparent proxy server.

This is a picture downloaded from the network, this is a typical nat structure. This structure can be used for simple testing. The LVS logo in the figure above is a Linux host that is responsible for balancing traffic. Usually called it a Linux virtual server. The RS1 identifier and the RS2 identifier are actual servers. The virtual server does not process service requests, and all requests are processed by the actual server. The nat structure in the above figure is very simple, and the network structure can be modified according to the actual situation.

Configuration Process on LVS

Load Balancing is a functional module at the kernel level that does not generally provide load balancing. So we need to recompile the kernel to support load balancing. We chose the latest version of the kernel version 2.6.14.

The following is the process of compiling and making the new kernel work correctly.

First download the source code package from www.kernel.org module-init-tools-3.1.tar.bz2

As you can see from the name, this is some tools related to the module. . We load balance as a module into the kernel.

Unzip with tar –jzvf, then follow the steps in the README to install.

./configure –prefix=/

make moveold

make

make install

module-init-tools installation Finished.

The following procedure for installing the 2.6.14 kernel

Download the source code package linux-2.6.14.2.tar.bz2 from the www.kernel.org to the /usr/src/directory

Decompress with tar –jxvf linux-2.6.14.2.tar.bz2 command

Generate linux-2.6.14 directory after decompression

Change this directory to mv linux-2.6. 14 linux

Then execute cd /usr/src/linux

make menuconfig This is a graphical kernel configuration tool. You can use this tool to select the

function of the new kernel. I won't explain it in detail here, just select exit.

Test

Place different index.html on 10.0.0.2, 10.0.0.3.10.0.0.4. The default home page location on redhat9 is

/var/www/html/. Then execute service httpd start. Browsing

192.168.88.23 on 192.168.88.21, one of them will appear index.html. Here you need to pay attention to the browser settings, you need to delete the temporary file and refresh it to see other index.html. This is a browser issue, not a configuration error. Being able to see different main pages shows that the three real servers are working properly and the cluster is working.

Questions

What if the machine responsible for traffic distribution is down or if there is a problem with the actual server?

The first problem is the hot backup. This is also the approach taken by most clusters. Need heatbeat software

The second problem is to configure keepalive software on a load balancing machine.

Copyright © Windows knowledge All Rights Reserved