LVS fullnat安装


阿里巴巴开源LVS fullnat (内核要求2.6.32)1、下载 fullnat LVS源码wget https://github.com/alibaba/LVS/tree/lvs_v2 #版本2,建议使用这个版本
wgethttps://github.com/alibaba/LVS/archive/master.zipunzipaster.zip; #解压下载的源码,主要有以下文件目录,其中 kernel目录是内核源码,tools里有ipvsadm 、keepalived、quagga(可以使用Quagga将linux机器打造成一台功能完备的路由器)、rpmAUTHORS CHANGES docs kernel README.md tools
2、内核编译&安装cd /usr/local/src/LVS-lvs_v2/kernel请先安装好 perl perl-devel popt popt-devellibnl libnl-devel libssllibssl-developenssl openssl-develpopt-staticyum -y install ncurses ncurses-devel去
掉udev,udev的编译要求比较严格,容易在启动时报udev: missing sysfs features免费云主机域名; please update
the kernel or disable the kernel’s CONFIG_SYSFS_DEPRECATED
option;出现这个错问题也不大vi .configCONFIG_SYSFS_DEPRECATED=nCONFIG_SYSFS_DEPRECATED_V2=n
mkdir -p/usr/src/kernels/2.6.32make O=/usr/src/kernels/2.6.32 menuconfig; #选择模块需要编译的,exit退出,选择 YES保存make mrpropermake O=/usr/src/kernels/2.6.32make O=/usr/src/kernels/2.6.32 modules_install install
make时遇错
/bin/sh: perl: command not foundmake[2]: *** [scripts/mod/empty.o] Error 127make[1]: *** [scripts/mod] Error 2make: *** [scripts] Error 2解决:yum -y perl perl-develmake install遇错WARNING: Couldn’t open directory /lib/modules/2.6.32: No such file or directory解决:ln -s /lib/modules/`uname -r` /lib/modules/2.6.32
问题:make install时报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_modERROR: modinfo: could not find module crc_t10dif解答:这是因为现在运行的kernel有这些模块,而新编译的内核没有这些模块。如果不需要可直接忽视,如果需要编译到新的内核中,请修改 .config的相关参数为=m
使用新编译的内核vi /boot/grub/grub.conf 修改default=0reboot 重启系统,uname -r查看到的版本应该是2.6.32
3、安装keepalived要求先安装好openssl openssl-develpopt-staticcd /usr/local/src/master/tools/keepalived/./configure –prefix=/usr/local/keepalived –with-kernel-dir=/usr/local/src/LVS-lvs_v2/kernel;make;最终结果:Keepalived configuration————————Keepalived version : 1.2.2Compiler : gccCompiler flags : -g -O2Extra Lib : -lpopt -lssl -lcrypto -lnlUse IPVS Framework : YesIPVS sync daemon support : YesIPVS use libnl : YesUse VRRP Framework : YesUse Debug flags : No
make install;
默认路径:/usr/local配置文件: /usr/local/etc/keepalived/keepalived.conf
自动启动脚本模板:/usr/local/etc/rc.d/init.d/keepalived
复制安装目录下的/usr/local/keepalived/etc/rc.d/init.d/keepalived 复制到 /etc/init.d/把/etc/init.d/keepalived 文件中. /etc/sysconfig/keepalived 改为 . /usr/local/keepalived/etc/sysconfig/keepalived
keepalived启动时报Starting keepalived: /bin/bash: keepalived: command not found解决方法: ln -s prefix/sbin/keepalived /usr/sbin/
4、安装ipvsadm依赖libnl libnl-devel libssl-devel libsslcd /usr/local/src/LVS-lvs_v2/tools/ipvsadm/make;make install;
make遇错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 -lnlcollect2: ld returned 1 exit statusmake: *** [ipvsadm] Error 1解决:yum -y installlibnl libnl-devel libssl-devel libssl
5、安装quaggacd /usr/local/src/LVS-lvs_v2/tools/quagga./configure –prefix=/usr/local/quaggamake;make install;
接下来的配置请参照LVS操作手册
查看IPVS详情查看 /proc/net目录下的ip_vs ip_vs_app ip_vs_conn ip_vs_conn_sync ip_vs_ext_stats ip_vs_stats

相关推荐: net-snmp 发送告警流程图

net-snmp 发送告警流免费云主机域名程图相关推荐: linux如何查看jdk安装路径本篇内容主要讲解“linux如何查看jdk安装路径”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“linux如何查看jdk安装…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

Like (0)
Donate 微信扫一扫 微信扫一扫
Previous 02/01 10:21
Next 02/01 10:21