阿里+lvs编译安装

阿里巴巴开源LVS fullnat  (内核要求2.6.32)

yum install perl perl-devel popt popt-devel libnl libnl-devel libssl libssl-devel openssl openssl-devel popt-static 
yum -y install ncurses ncurses-devel
1 下载源码 
git clone https://github.com/alibaba/LVS.git
2编译内核
cd  /usr/local/src/LVS-lvs_v2/kernel
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;   #选择模块需要编译的,exit退出,选择 YES保存
make mrproper
make O=/usr/src/kernels/2.6.32
make O=/usr/src/kernels/2.6.32 modules_install install
 2 安装keepalived  
cd  /usr/local/src/LVS/tools/keepalived/
./configure --prefix=/usr/local/keepalived --with-kernel-dir=/usr/local/src/LVS-lvs_v2/kernel;
make
最终结果:
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
make install

默认路径: /usr/local
配置文件: /usr/local/etc/keepalived/keepalived.conf
自动启动脚本模板: /usr/local/etc/rc.d/init.d/keepalived


4、安装ipvsadm
依赖 libnl libnl-devel  libssl-devel libssl
cd /usr/local/src/LVS-lvs_v2/tools/ipvsadm/
make
make install
[[email protected] ipvsadm]# make install
if [ ! -d /sbin ]; then mkdir -p /sbin; fi
install -m 0755 ipvsadm /sbin
install -m 0755 ipvsadm-save /sbin
install -m 0755 ipvsadm-restore /sbin
[ -d /usr/man/man8 ] || mkdir -p /usr/man/man8
install -m 0644 ipvsadm.8 /usr/man/man8
install -m 0644 ipvsadm-save.8 /usr/man/man8
install -m 0644 ipvsadm-restore.8 /usr/man/man8
[ -d /etc/rc.d/init.d ] || mkdir -p /etc/rc.d/init.d
install -m 0755 ipvsadm.sh /etc/rc.d/init.d/ipvsadm

查看IPVS详情 
查看 /proc/net目录下的 
ip_vs ip_vs_app ip_vs_conn ip_vs_conn_sync ip_vs_ext_stats ip_vs_stats

5、安装quagga


cd /usr/local/src/LVS-lvs_v2/tools/quagga
./configure --prefix=/usr/local/quagga
make
make install




参照博客http://blog.51cto.com/tianshili/1638486

你可能感兴趣的:(阿里+lvs编译安装)