1、去keepalived官方下载地址下载源码包 keepalived-2.0. : /#
2、若需要支持IPv6,安装libnl3-dev:
yum -y install libnl-devel libnl3-devel
像我redhat不能用yum就安装三个包:
-
rpm -ivh libnl3-3.2.21-8.el6.x86_64.rpm
-
rpm -ivh libnl3-cli-3.2.21-8.el6.x86_64.rpm
-
rpm -ivh libnl3-devel-3.2.21-8.el6.x86_64.rpm
3、解压keepalived:
tar -xvf keepalived-2.0.13.
4、编译、安装
-
cd keepalived-2.0.13
-
./configure
-
make && make install
5、拷贝配置文件、执行文件
-
cp ./keepalived/keepalived /usr/sbin/
-
cp ./keepalived/etc//keepalived /etc//
-
mkdir /etc/keepalived
-
cp ./keepalived/etc/keepalived/ /etc/keepalived/
-
cp ./keepalived/etc/sysconfig/keepalived /etc/sysconfig/keepalived
6、起服务
-
service enable keepalived
-
service start keepalived
7、有时候编译不通过,报以下错误,则安装openssl-devel包,可用 yum -y install openssl-devel或者下载openssl openssl-devel rpm包安装解决。
“!!! OpenSSL is not properly installed on your system. !!!
!!! Can not include OpenSSL headers files.!!!"