Patch IPVS for Linux kernel-general Linux technology-Linux programming and kernel information. For more information, see the following section. This article is for reference only
Install
First, when installing Red Hat 7.2, You must select all the library files and compilation tools for compiling the kernel. If the Kernel cannot be compiled after the system is installed, reinstall the RPM package starting with Kernel on the installation disc. Shut down some less frequently-used services and restart them.
Decompress the downloaded kernel and place it in the/usr/src/directory. The command is as follows:
# Tar xzvf linux-2.4.21.tar.gz-C/usr/src
# Cd/usr/src
# Ln-s./linux-2.4.21 for linux
In the/usr/src directory, patch the new kernel with IPVS. The command is as follows:
# Gunzip linux-2.4.21-ipvs-1.0.10.patch.gz | patch-p0 // load IPVS patches into kernel code
If you are using Direct Routing or ip tun mode, you also need to load the patch (hidden-2.4.20pre10-1.diff) file of "hidden", put it in the/usr/src directory, and use the following command:
# Cat hidden-2.4.20pre10-1.diff | patch-p0
Kernel configuration
Before compilation, the Kernel configuration is very important. The command is as follows:
# Cd linux // enter the compiling directory
# Make mrproper // Delete the. o file generated in the previous compilation.
# Make menuconfig
In the Kernel configuration process, the most important thing is the NIC Driver. If you cannot drive the NIC well, all the work will be futile. Next, pay attention to the following items in the compilation options:
Code maturity level options --->
Prompt for development and/or incomplete code/drivers #### Select Code Maturity Networking options --->
For the Configuration of "IP: Virtual Server Configuration", see.
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // tech.ccidnet.com/pub/attachment/2004/11/359913.jpg'); ">
IP: Virtual Server Configuration Setting Interface
Compile the kernel
After you save the configurations and exit, the system prompts you to run the "make dep" command. The specific process is as follows:
# Make dep // it takes some time to ensure all Dependencies # Make clean // clear unnecessary intermediate code # Make bzImage // start to compile the kernel. A lot of compilation content appears on the screen, About 20 minutes, depending on the system strength # Make modules // compilation Module # Make modules_install // installation Module # Cp arch/i386/boot/bzImage/boot/vmlinuz-2.4.21-lvs # Cp System. map/boot/System. map.2.4.21-lvs
Modify LILO
If you use LILO boot, you need to modify/etc/lilo. conf in the following format:
# Vi/etc/lilo. conf Prompt Timeout = 50 Boot =/dev/hda Map =/boot/map Install =/boot. B Linear Image =/boot/vmlinuz-2.4.7-10 Label = linux Root =/dev/hda5 Read-only Image =/boot/vmlinuz-2.4.21-lvs Label = lvs Root =/dev/hda5 Read-only # Add the preceding Section Other =/dev/hda1 Label = win Table =/dev/had # End editing and exit # Lilo // run LILO again
If GRUB boot is used, you need to set/boot/grub. conf.
Restart the instance, select the LVS kernel to start the instance, check whether an error occurs during the boot process, and then check whether/proc/sys/net/ipv4/conf/all/hidden exists. If it does not exist, it indicates that there is a problem in compilation. We recommend that you recompile it. If everything goes well, you can install the binary software package of ipvsadm. After installation, run the following command to check whether the installation is successful:
# Ipvsadm // s management software IP Virtual Server version 1.0.9 (size = 4096) Prot LocalAddress: Port sched1_flags -> RemoteAddress: Port Forward Weight ActiveConn InActConn
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