红联Linux门户
Linux帮助

CentOS 6.4安装LVS+Keepalive

发布时间:2015-04-04 22:00:02来源:linux网站作者:jishuweiwang

Linux系统:CentOS 6.4

环境说明:
[root@db html]# uname -a
Linux db 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@db html]# cat /etc/RedHat-release
CentOS release 6.4 (Final)


lvs安装部署:

1、查看内核模块是否支持
lsmod | grep ip_vs  #发现没有
2、安装
wget http://www.linuxvirtualserver.org/software/kernel-2.6/ipvsadm-1.26.tar.gz
tar zxf ipvsadm-1.26.tar.gz
cd ipvsadm-1.26
yum -y install kernel-devel
ln -s /usr/src/kernels/2.6.32-431.17.1.el6.x86_64/ /usr/src/linux
make && make install

3、报错信息解决

报错:
make[1]: *** [libipvs.o] Error 1
make[1]: Leaving directory `/mnt/tools/ipvsadm-1.26/libipvs'
make: *** [libs] Error 2
解决:
yum -y install libnl* popt*

4、加载ip_vs模块
#执行ipvsadm命令加载
ipvsadm
#查看结果
[root@shell ~]# lsmod |grep ip_vs
ip_vs_rr                1420  1
ip_vs                115643  3 ip_vs_rr
libcrc32c              1246  1 ip_vs
ipv6                  321422  137 ip_vs


keepalived安装部署:
yum install openssl openssl-devel –y
yum install popt* -y
wget http://www.keepalived.org/software/keepalived-1.1.19.tar.gz
tar zxf keepalived-1.1.19.tar.gz
cd keepalived-1.1.19
#./configure && make && make install
./configure --sysconf=/etc  && make && make install
/bin/cp /usr/local/sbin/keepalived /usr/sbin/

OK,上述步骤已经完成。