- 下载地址:点我下载
- 解压
tar -zxvf keepalived-2.0.18.tar.gz
-
解压后进入到解压出来的目录,看到会有 configure,那么就可以做配置了(配置安装和 nginx 一模一样)
- 使用 configure 命令配置安装目录与核心配置文件所在位置:
./configure --prefix=/usr/local/keepalived --sysconf=/etc
- prefix:keepalived 安装的位置
- sysconf:keepalived 核心配置文件所在位置,固定位置,改成其他位置则 keepalived 启动不了,/var/log/messages 中会报错
4.1 配置过程中可能会出现警告信息,如下所示:
*** WARNING - this build will not support IPVS with IPv6. Please install libnl/libnl-3 dev libraries to support IPv6 with IPVS.
4.2 安装libnl/libnl-3依赖
yum -y install libnl libnl-devel
4.3 重新 configure 一下,此时 OK
./configure --prefix=/usr/local/keepalived --sysconf=/etc
- 安装 keepalived
make && make install
-
进入到 /etc/keepalived,该目录下为 keepalived 核心配置文件
-
如果忘记安装配置的目录,则通过如下命令找到: