How To Install keepalived on CentOS 7

In this tutorial we learn how to install keepalived on CentOS 7. keepalived is Load balancer and high availability service

Introduction

In this tutorial we learn how to install keepalived on CentOS 7.

What is keepalived

Keepalived provides simple and robust facilities for load balancing and high availability. The load balancing framework relies on the well-known and widely used Linux Virtual Server (IPVS) kernel module providing layer-4 (transport layer) load balancing. Keepalived implements a set of checkers to dynamically and adaptively maintain and manage a load balanced server pool according their health. Keepalived also implements the Virtual Router Redundancy Protocol (VRRPv2) to achieve high availability with director failover.

We can use yum or dnf to install keepalived on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install keepalived.

Install keepalived on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install keepalived using yum by running the following command:

sudo yum -y install keepalived

Install keepalived on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install keepalived using dnf by running the following command:

sudo dnf -y install keepalived

How To Uninstall keepalived on CentOS 7

To uninstall only the keepalived package we can use the following command:

sudo dnf remove keepalived

References

Summary

In this tutorial we learn how to install keepalived on CentOS 7 using yum and dnf.