安装keepalived
liyuzhel
9年前
来自: http://my.oschina.net/luciamoore/blog/607034
实验需求:
-
安装keepalived(仅安装)
实验实现:
-
服务器:CentOS 6.5-minimal
-
软 件:Keepalived ( V_1.2.19 )
安装过程:
>>>下载安装包并解压,查看相关参数
[root@lucia tmp]# wget http://www.keepalived.org/software/keepalived-1.2.19.tar.gz # 下载Keepalived安装包 [root@lucia tmp]# tar -zxf keepalived-1.2.19.tar.gz #解压安装包 [root@lucia host tmp]# cd keepalived-1.2.19 [root@lucia keepalived-1.2.19]# ./configure --help #查看confiure编译参数 =============================================== 指定安装在/etc/ {--sysconfdir=/etc} 指定使用内核源码中的头文件 {--with-kernel-dir} 注:使用LVS时,需要用到"--with-kernel-dir" ===============================================
>>>编译安装
[root@lucia keepalived-1.2.19]# [ -z /usr/src/kernels/ ] && yum -y install kernel-headers kernel-devel || echo "The kernel file already exists" The kernel file already exists =========================== #判断kernels目录是否存在文件 =========================== [root@lucia keepalived-1.2.19]# ./configure --sysconfdir=/etc/ --with-kernel-dir=/usr/src/kernels/2.6.32-573.12.1.el6.x86_64 ============================================================================ #./configure 对即将安装的软件进行配置,检查当前的环境是否满足要安装软件的依赖关系 ============================================================================ configure: error: in `/tmp/keepalived-1.2.19': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details ============================================================================ 报错:gcc编译器没有安装 [root@lucia keepalived-1.2.19]# yum -y install gcc ============================================================================= 继续返回上一步预安装./configure [root@lucia keepalived-1.2.19]# ./configure --sysconfdir=/etc/ --with-kernel-dir=/usr/src/kernels/2.6.32-573.12.1.el6.x86_64 configure: error: !!! OpenSSL is not properly installed on your system. !!! !!! Can not include OpenSSL headers files. !!! ========================================================================= 报错:OpenSSL 没有安装 [root@lucia keepalived-1.2.19]# yum -y install openssl* ========================================================================= ./configure 成功后,显示是Keepalived 输出的加载模块信息 Keepalived configuration ------------------------ Keepalived version : 1.2.19 Compiler : gcc Compiler flags : -g -O2 Extra Lib : -lssl -lcrypto -lcrypt Use IPVS Framework : Yes IPVS sync daemon support : Yes IPVS use libnl : No fwmark socket support : Yes Use VRRP Framework : Yes Use VRRP VMAC : Yes SNMP support : No SHA1 support : No Use Debug flags : No [root@lucia keepalived-1.2.19]# make && make install #编译&&安装 [root@lucia keepalived-1.2.19]# ln -s /usr/local/sbin/keepalived /sbin/ #软链接到系统使用的管理程序目录中 [root@lucia keepalived-1.2.19]# chkconfig --add keepalived #添加到系统服务 [root@lucia keepalived-1.2.19]# chkconfig --level 35 keepalived on #添加到开机启动