一、背景
因国产化OS改造,对Keepalived迁移重新部署,现场版本比较老,采用2.0.6版本,本次迁移,只迁移配置文件和自启动服务;其他考虑环境依赖,在目标OS上重新编译安装。
资源链接:openssl.官网
二、编译安装
wget -q http://www.keepalived.org/software/keepalived-2.0.6.tar.gz
tar -zxvf keepalived-2.0.6.tar.gz
cd keepalived-2.0.63
./configure --prefix=/usr/local/keepalived
make depend
make && make install
cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/ //在编译后的keepalived目录下
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/
chkconfig --add keepalived
chkconfig --level 345 keepalived on
systemctl start keepalived
systemctl status keepalived //验证vip是否正常
telnet vip port //验证虚拟服务是否正常
1)第一次报错:OpenSSL is not properly installed on your system. Can not include OpenSSL headers files.
这主要是系统确认openssl依赖的头文件,在openssl-devel这个包里面了,执行:yum install openssl-devel
2)完成上述后,再次configure,报错:libnl/libnl-3 dev libraries to support IPv6 with IPVS,即libnl/libnl-3 dev库缺失
执行:yum install libnl*-devel -y
3)第3次执行configure,报错:configure: error: libnfnetlink headers missing
执行:yum install libnfnetlink-devel -y
4)再次执行configure后恢复:
5)make && make install