Keepalived安装以及配置

keepalived的下载地址:https://www.keepalived.org/download.html

安装步骤

(1)将下载好的keepalived压缩文件上传搭到服务器,老猫放到了/home/software下面。

(2)解压操作(老猫当前用的这个版本大家也可以在留言区留言,老猫看到后会发到大家的邮箱)

1
tar -zxvf keepalived-2.0.18.tar.gz

(3)解压之后进入到解压之后的目录,看到configure,那么此时就可以做配置了,安装的步骤和nginx的安装步骤类似。
图1

(4) 使用configure命令安装目录与核心配置文件所在的位置。

1
2
3
4
5
./configure --prefix=/usr/local/keepalived --sysconf=/etc

说明:
prefix:keepalived的安装位置。
sysconf:Keepalived的核心配置文件所在位置,固定位置,改成其他位置则keepalived启动不了,/var/log/messages中会报错。

​ 安装过程中可能遇到的警告信息:

1
*** WARNING - this build will not support IPVS with IPv6. Please install libnl/libnl-3 dev libraries to support IPv6 with IPVS.

​ 如果遇到上述警告可以安装libnl/libnl-3

1
yum -y install libnl libnl-devel

​ 然后重复步骤(4)重新配置一下configure,此时配置OK

(5)安装keepalived:

1
make && make install

(6)进入到cd /etc/keepalived/,该目录下为keepalived的核心配置文件,如果忘记安装目录,那么此时可以通过如下命令即可找到:

1
whereis keepalived

配置

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×