Implementation of Linux cluster with LVS software under Linux

Source: Internet
Author: User
Tags diff ftp socket ftp protocol

This paper introduces the cluster software LVS under Linux, and gives an example of the detailed process of installation and implementation of cluster (cluster) under Linux.
In a variety of network services widely used today, with the speed of the network and increase the number of users, in some busy occasions, a single machine can not be able to cope with all the network requests. To solve this problem, many users use a set of cluster (clusters) to replace a single machine. Cluster can connect more than one computer to work together to provide a variety of services, such as Apache, FTP, mail and so on.

The most common, and probably the most widely used, cluster solution on Linux is LVs (Linux Virtual
Server), I am pleased that LVS is also a Chinese open source project created and developed. LVS since 1998, has developed to now is a relatively mature technology project. There are many more famous websites and organizations in the use of LVS erected cluster, such as: Www.linux.com, SourceForge.net, www.real.com and so on.

The following begins to introduce, the author is how to use LVS to set up a group of cluster to provide Apache and FTP services.

Install the operating system

The author chose Red Hat 9.0 as the operating system for some cluster director machines and all real server machines. RH installation Process Conlio, the author according to actual needs, only installed a small number of packages. For mass installation of Linux, it is recommended to try kickstart to enter the batch installation.

Compiling a kernel that supports LVS

LVS has modified and increased the Linux kernel, so recompile the Linux kernel. We first download from the http://www.linuxvirtualserver.org to the LVS kernel patch, the original kernel source code to update, and then recompile Linux kernel.

Download LVS kernel patches to note that the patch version to be consistent with the kernel version, for RH9.0, its Linux core version is 2.4.20, so the corresponding kernel patch should be http://www.linuxvirtualserver.org/ Software/kernel-2.4/linux-2.4.20-ipvs-1.0.9.patch.gz

There is also a patch is used to solve some cases in the ARP protocol does not work properly, download from the Http://www.ssi.bg/~ja/hidden-2.4.20pre10-1.diff.
Copy the two patches downloaded above to the/USR/SRC directory, and then execute the following command:
Cd/usr/src
GZIP-CD linux-2.4.20-ipvs-1.0.9.patch.gz
Cd/usr/src/linux
Patch-p1. /linux-2.4.20-ipvs-1.0.9.patch
Patch-p1. /hidden-2.4.20pre10-1.diff

Make Mrproper
Make Menuconfig

When you execute make menuconfig, we will enter a graphical interface where you can set the Linux kernel in detail. LVS-related kernel options are in "Networking options" and go to "networking options" to view the "Ip:virtual Server Configuration" option, Select all of the other child options:

Virtual Server Support (experimental)
[*] IP Virtual Server debugging
(Ipvs connection Table size (the nth power of 2)
---IPVS scheduler
round-robin Scheduling
weighted Round-robin Scheduling
least-connection Scheduling scheduling
weighted least-connection Scheduling
locality-based least-connection Scheduling
locality-based least-connection with replication scheduling
Destination Hashing Scheduling
Source Hashing Scheduling
Shortest expected delay scheduling
never queue scheduling
---Ipvs application helper
FTP Protocol Helper

In addition, all the subkeys of the options in Ip:netfilter Configuration in networking options, except for the following two items, are optional:
"> IPChains (2.2-style) support
"> Ipfwadm (2.0-style) support

Also, "Networking options" There are some of the choices about the network, pay attention to their own needs to choose:
<*> Packet Socket
[] Packet socket:mmapped IO
<*> NetLink device emulation
[*] Network packet filtering (replaces IPChains)
[*] Network packet filtering debugging
[*] Socket filtering
<*> Unix domain sockets
[*] TCP/IP Networking
[*] Ip:multicasting
[*] ip:advanced Router
[*] Ip:policy Routing
[] ip:use netfilter MARK value as routing key
[] ip:fast network address translation
ip:tunneling

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.