keepalived源码安装

1、先安装keepalived依赖组件

yum -y install libnl libnl-devel libnfnetlink-devel popt-devel  gcc make

2、获取压缩包,进行解压

cd /usr/src
wget http://www.keepalived.org/software/keepalived-1.2.7.tar.gz
tar zxvf keepalived-1.2.7.tar.gz
cd keepalived-1.2.7

3、预编译

./configure --prefix=/usr/local/keepalived

编译结果

keepalived源码安装_第1张图片

编译、安装

make && make install

4、把keepalived的启动文件复制到init.d,加入开机启动项

cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/

将keepalived文件拷贝到/etc下

cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/

将配置文件拷贝到/etc/keepalived下

mkdir /etc/keepalived
cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/

将keepalived加入系统命令系统

cp /usr/local/sbin/keepalived /usr/sbin/

#到这里源码安装Keepalived就已经完成

 

 

你可能感兴趣的:(linux运维,keepalived)