keepalived源码编译安装

时间:2025-03-31 09:15:28

1、去keepalived官方下载地址下载源码包  keepalived-2.0. :    /#

2、若需要支持IPv6,安装libnl3-dev:

yum -y install libnl-devel libnl3-devel

    像我redhat不能用yum就安装三个包:

  1. rpm -ivh libnl3-3.2.21-8.el6.x86_64.rpm
  2. rpm -ivh libnl3-cli-3.2.21-8.el6.x86_64.rpm
  3. rpm -ivh libnl3-devel-3.2.21-8.el6.x86_64.rpm

3、解压keepalived:

tar -xvf keepalived-2.0.13.

4、编译、安装

  1. cd keepalived-2.0.13
  2. ./configure
  3. make && make install

5、拷贝配置文件、执行文件

  1. cp ./keepalived/keepalived /usr/sbin/
  2. cp ./keepalived/etc//keepalived /etc//
  3. mkdir /etc/keepalived
  4. cp ./keepalived/etc/keepalived/ /etc/keepalived/
  5. cp ./keepalived/etc/sysconfig/keepalived /etc/sysconfig/keepalived

6、起服务

  1. service enable keepalived
  2. 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.!!!"