[Linux] Install keepalived on CentOS

本文介绍了通过源代码安装Keepalived的方法,并提供了详细的步骤指导。同时,文章还提到了如何配置Keepalived使其正常工作,以及在使用firewalld的情况下如何设置规则允许VRRP控制流量。
摘要由CSDN通过智能技术生成

Installing

Although installing keepalived through yum is quite convenient, the package is often out-of-date.

So it is recommended to install it from source code. To do so, you can follow the instructions here.

If you already installed it through yum, you can upgrade to a new version by
1. Download the source code from official website
2. Extract the files via tar xvf <package_name>
3. Change the working directory to the extracted folder
4. Run ./configure
5. Run make && make install

You will notice that the newer version of keepalived is installed under /usr/local/sbin and the system is still using the old version located at /usr/sbin

So, you need to

  • rename the old one
mv /usr/sbin/keepalived /usr/sbin/keepalived.old
  • create a symbolic link for the new one
ln -s /usr/local/sbin/keepalived /usr/sbin/

Configuring

The configuration needed to get it working is simple, just reference the previous link.

Attention
If you have firewalld running, you will need to add the following rule in order to permit the vrrp control traffic.

firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" destination address="224.0.0.18" protocol value="ip" accept' --permanent
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值