Linux安装keepalived

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

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

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

Linux安装keepalived

 

 

第四步:进入解压的文件夹,编译安装  ./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

Linux安装keepalived

 

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

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

Linux安装keepalived

 

cp /software/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/
Linux安装keepalived

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

Linux安装keepalived

 

 第九步:启动keepalived:systemctl start keepalived

查看状态 systemctl status keepalived

Linux安装keepalived

 

 

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

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

Linux安装keepalived

 

 vi /etc/keepalived/keepalived.conf

Linux安装keepalived

 

上一篇:openEuler 配置网卡自动启动,设置固定ip


下一篇:Linux基础模块--day1(网络配置&yum源)