有2台机器,每台都有1个zabbix-server,然后再每台上再装一个keepalived
keepalived官网的软件下载页是这个
https
文章目录
1,创建安装路径
mkdir /usr/share/keepalived/
2,在这个安装路径下面下载keepalived的软件包
我选的版本是1.3.5,你们要别的版本可以去官网下载页面找所需版本。
wget https://www.keepalived.org/software/keepalived-1.3.5.tar.gz
3,解压缩软件包
tar -xvzf keepalived-1.3.5.tar.gz
再进入解压后的文件夹
cd keepalived-1.3.5
4,基础环境软件包安装
大概率你们解压后再安装keepalived会报错,执行一下这句
yum install gcc-c++ openssl-devel libnl libnl-devel libnfnetlink-devel -y
5, 执行/usr/share/keepalived/keepalived-1.3.5文件夹下面的configure
./configure --prefix=/usr/apps/keepalived --sysconf=/etc
6,编译
make && make install
安装完成可以看到/usr/apps/keepalived 多了三个目录 sbin bin share。
ls /usr/apps/keepalived
7,cd 到/usr/apps/keepalived 然后执行ln命令创建软连接
cd /usr/apps/keepalived
ln -s sbin/keepalived /sbin
8,复制需要的文件到 /etc
打开keepalived 的安装路径
cd /usr/share/keepalived/
然后在这个安装路径中往下寻找到init.d
这个文件夹,具体路径是这个/usr/share/keepalived/keepalived-1.3.5/keepalived/etc/init.d
,
再进行相关复制操作:
cp /usr/share/keepalived/keepalived-1.3.5/keepalived/etc/init.d/keepalived /etc/init.d
9,增加系统服务
chkconfig --add keepalived
systemctl enable keepalived.service
systemctl start keepalived.service
# 启动 服务