How to patch the Linux kernel with IPVS

Source: Internet
Author: User
Article title: Teach you how to patch the kernel with IPVS. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
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 --->
[*] Network packet filtering (replaces ipchains)
[] Network packet filtering debugging
...
IP: Netfilter Configuration --->
  
For the Configuration of "IP: Virtual Server Configuration", see.
   [[The No.1 Picture.]
  
   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.
  
Default = 1
Timeout = 10
Splashimage = (hd0, 0)/boot/grub/splash.xpm.gz
Title Linux (2.4.7-10)
Root (hd0, 0)
Kernel/boot/vmlinuz-2.4.7-10 ro
Root = LABEL =/initrd/boot/initrd-2.4.7-10.img.
Title LVS (2.4.21-lvs)
Root (hd0, 0)
Kernel/boot/vmlinuz-2.4.21-lvs ro
Root = LABEL =/initrd/boot/initrd-2.4.21-lvs.img.
Title Windows
Map (hd0) (hd1)
Map (hd1) (hd0)
Root (hd1, 0)
Chainloader (hd1, 0) + 1
Makeactive
Boot
  
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 s management software
IP Virtual Server version 1.0.9 (size = 4096)
Prot LocalAddress: Port sched1_flags
-> RemoteAddress: Port Forward Weight ActiveConn InActConn
  
  
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.