Linux教程

Linux安装keepalived

本文主要是介绍Linux安装keepalived,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

第一步:先安装依赖包     yum install -y libselinux-devel openssl-devel krb5-devel 

第二步:在官网下载安装包:https://www.keepalived.org/download.html

第三步:把安装包传上服务器,解压。

 

 

第四步:进入解压的文件夹,编译安装  ./configure --prefix=/software/keepalived

//没有权限的话用sudo或者root,但我在make install 时 在/usr/lib/systemd/system下创建文件时sudo还是不够权限,所以只能用root

第五步:make && make install

第六步:cp /software/tools/keepalived-2.2.2/keepalived/etc/init.d/keepalived /etc/init.d

 

第七步:创建文件夹 mkdir /etc/keepalived 

第八步:cp  /software/tools/keepalived-2.2.2/keepalived/etc/sysconfig/keepalived  /etc/sysconfig/

 

cp /software/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/

cp /software/keepalived/sbin/keepalived /usr/sbin/

 

 第九步:启动keepalived:systemctl start keepalived

查看状态 systemctl status keepalived

 

 

如果起不来 检查下网卡名称是否一致,如果不对,请修改一致:

cd /etc/sysconfig/network-scripts/ifcfg-ens160

 

 vi /etc/keepalived/keepalived.conf

 

这篇关于Linux安装keepalived的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!