1. Background
Due to the localized OS transformation, Keepalived was migrated and redeployed. The on-site version is relatively old and uses version 2.0.6. In this migration, only the configuration files and self-starting services are migrated; other environmental dependencies are considered and recompiled and installed on the target OS.
Resource link: openssl.official website
2. Compile and install
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) The first error: OpenSSL is not properly installed on your system. Can not include OpenSSL headers files.
This is mainly because the system confirms that the header files that openssl depends on are in the openssl-devel package. Execute:yum install openssl-devel
2) After completing the above, configure again, and an error message appears: libnl/libnl-3 dev libraries to support IPv6 with IPVS, that is, the libnl/libnl-3 dev library is missing.
implement:yum install libnl*-devel -y
3) When executing configure for the third time, an error is reported: configure: error: libnfnetlink headers missing
implement:yum install libnfnetlink-devel -y
4) Restore after executing configure again:
5) make && make install