How To Install redis on CentOS 7

In this tutorial we learn how to install redis on CentOS 7. redis is A persistent key-value database

Introduction

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

What is redis

Redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. You can run atomic operations on these types, like appending to a string; incrementing the value in a hash; pushing to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set. In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while, or by appending each command to a log. Redis also supports trivial-to-setup master-slave replication, with very fast non-blocking first synchronization, auto-reconnection on net split and so forth. Other features include Transactions, Pub/Sub, Lua scripting, Keys with a limited time-to-live, and configuration settings to make Redis behave like a cache. You can use Redis from most programming languages also.

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

Install redis on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install redis

Install redis 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 redis using dnf by running the following command:

sudo dnf -y install redis

How To Uninstall redis on CentOS 7

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

sudo dnf remove redis

References

Summary

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