Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

LVS fullnat installation

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Alibaba open source LVS fullnat (kernel requirement 2.6.32)

1. Download the fullnat LVS source code

Wget https://github.com/alibaba/LVS/tree/lvs_v2 # version 2, which is recommended

Wget https://github.com/alibaba/LVS/archive/master.zip

Unzip aster.zip; # decompresses and downloads the source code, mainly in the following file directory, in which the kernel directory is the kernel source code, and the tools contains ipvsadm, keepalived, quagga (you can use Quagga to build a linux machine into a fully functional router) and rpm

AUTHORS CHANGES docs kernel README.md tools

2. Kernel compilation & installation

Cd / usr/local/src/LVS-lvs_v2/kernel

Please install perl perl-devel popt popt-devel libnl libnl-devel libssl libssl-devel openssl openssl-devel popt-static yum-y install ncurses ncurses-devel first

Getting rid of the compilation requirements of udev,udev is relatively strict, and it is easy to have this error problem in the startup times udev: missing sysfs features; please update the kernel or disable the kernel's CONFIG_SYSFS_DEPRECATED option;.

Vi .config

CONFIG_SYSFS_DEPRECATED=n

CONFIG_SYSFS_DEPRECATED_V2=n

Mkdir-p / usr/src/kernels/2.6.32

Make O=/usr/src/kernels/2.6.32 menuconfig; # Select the module that needs to be compiled, exit exit, select YES to save

Make mrproper

Make O=/usr/src/kernels/2.6.32

Make O=/usr/src/kernels/2.6.32 modules_install install

Encountered an error in make

/ bin/sh: perl: command not found

Make [2]: * * [scripts/mod/empty.o] Error 127

Make [1]: * * [scripts/mod] Error 2

Make: * * [scripts] Error 2

Solution: yum-y perl perl-devel

Make install encountered an error

WARNING: Couldn't open directory / lib/modules/2.6.32: No such file or directory

Solution: ln-s / lib/modules/ `uname-r` / lib/modules/2.6.32

Question: make install Times

Sh / usr/local/src/LVS-lvs_v2/kernel/arch/x86/boot/install.sh 2.6.32 arch/x86/boot/bzImage\

System.map "/ boot"

ERROR: modinfo: could not find module sd_mod

ERROR: modinfo: could not find module crc_t10dif

Answer: this is because the current running kernel has these modules, while the newly compiled kernel does not have these modules. If you don't need it, you can ignore it directly, and if you need to compile to a new kernel, modify the relevant parameter of .config to = m.

Using newly compiled kernel vi / boot/grub/grub.conf modifications

Default=0

When reboot restarts the system, the version found by uname-r should be 2.6.32.

3. Install keepalived

Openssl openssl-devel popt-static is required to be installed first.

Cd / usr/local/src/master/tools/keepalived/

. / configure-prefix=/usr/local/keepalived-with-kernel-dir=/usr/local/src/LVS-lvs_v2/kernel

Make

End result:

Keepalived configuration

-

Keepalived version: 1.2.2

Compiler: gcc

Compiler flags:-g-O2

Extra Lib:-lpopt-lssl-lcrypto-lnl

Use IPVS Framework: Yes

IPVS sync daemon support: Yes

IPVS use libnl: Yes

Use VRRP Framework: Yes

Use Debug flags: No

Make install

Default path: / usr/local

Configuration file: / usr/local/etc/keepalived/keepalived.conf

Auto start script template: / usr/local/etc/rc.d/init.d/keepalived

Copy / usr/local/keepalived/etc/rc.d/init.d/keepalived from the installation directory to / etc/init.d/

Put / etc/init.d/keepalived in the file

. / etc/sysconfig/keepalived changed to

. / usr/local/keepalived/etc/sysconfig/keepalived

Keepalived launch Times Starting keepalived: / bin/bash: keepalived: command not found

Solution: ln-s prefix/sbin/keepalived / usr/sbin/

4. Install ipvsadm

Rely on libnl libnl-devel libssl-devel libssl

Cd / usr/local/src/LVS-lvs_v2/tools/ipvsadm/

Make

Make install

Make encountered an error

Gcc-Wall-Wunused-Wstrict-prototypes-g-o ipvsadm ipvsadm.o config_stream.o dynamic_array.o.. / keepalived/keepalived/libipvs-2.6/libipvs.a-lpopt-lnl

/ usr/bin/ld: cannot find-lnl

Collect2: ld returned 1 exit status

Make: * * [ipvsadm] Error 1

Solution: yum-y install libnl libnl-devel libssl-devel libssl

5. Install quagga

Cd / usr/local/src/LVS-lvs_v2/tools/quagga

. / configure-- prefix=/usr/local/quagga

Make

Make install

For the next configuration, please refer to the LVS operation manual.

View IPVS details

View the / proc/net directory

Ip_vs ip_vs_app ip_vs_conn ip_vs_conn_sync ip_vs_ext_stats ip_vs_stats

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report