keepalived安装纪实
系统环境
cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m
1.下载最新版本的keepalived
wget
2.解压
tar -xvzf keepalived-1.2.19.tar.gz
3.到解压目录直接./configure
提示
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/keepalived-1.2.19':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
应该是gcc什么的没装
于是yum install gcc* -y
再次./configure
提示
checking openssl/ssl.h usability... no
checking openssl/ssl.h presence... no
checking for openssl/ssl.h... no
configure: error:
!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files. !!!
查看INSTALL文件
Libraries dependency
====================
In order to compile Keepalived needs the following libraries :
* OpenSSL, <
* popt
于是yum install openssl-devel.x86_64 popt-devel.x86_64 -y
再次./configure就成功了
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
4.make && make install
5.修改配置文件路径
# cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/
# cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/
# mkdir /etc/keepalived
# cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/
# cp /usr/local/sbin/keepalived /usr/sbin/
6.加入到开机启动
[root@VM-c248a334-5bfc-4a1c-a1e6-a97d45ad5045 rc3.d]# chkconfig --add keepalived
[root@VM-c248a334-5bfc-4a1c-a1e6-a97d45ad5045 rc3.d]# ll |grep keep
lrwxrwxrwx. 1 root root 20 Jan 30 16:48 K79keepalived -> ../init.d/keepalived
[root@VM-c248a334-5bfc-4a1c-a1e6-a97d45ad5045 rc3.d]# chkconfig --level 35 keepalived on
[root@VM-c248a334-5bfc-4a1c-a1e6-a97d45ad5045 rc3.d]# ll |grep keep
lrwxrwxrwx. 1 root root 20 Jan 30 16:49 S21keepalived -> ../init.d/keepalived
[root@VM-c248a334-5bfc-4a1c-a1e6-a97d45ad5045 rc3.d]#