How to install configure Redis on Rocky Linux / Centos 8

Introduction

Redis is a popular open-source database management system known for its high performance and diverse features, widely used in distributed systems. This article provides a detailed guide on how to install and configure Redis on Rocky Linux / CentOS 8, covering everything from basic installation to advanced configuration to ensure optimal performance and security.

What is Redis Server?

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker from https://redis.io/

Install configure Redis on Rocky Linux / Centos 8

Step 1: Update your Rocky Linux/Centos 8 Server 

sudo dnf -y update
Step 2: Install Redis Server
 

I will use remi release to install Redis module

  sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
List redis using command below
   sudo dnf module list redis
How to install configure Redis on Rocky Linux / Centos 8

Enable redis 6

   sudo dnf module enable redis:remi-6.2 -y

How to install configure Redis on Rocky Linux / Centos 8

In Redis Server.

  sudo dnf install redis
 How to install configure Redis on Rocky Linux / Centos 8

Start/Enable Redis Server.

sudo systemctl start redis
sudo systemctl enable redis
sudo systemctl status redis

Configuring Redis

The redis configure file located in path /etc/redis/redis.conf
In this section, I will update the redis configure allow remote access, to set an Authentication password, to add a pid file and to Set Persistent Store for Recovery.

Edit config file as below:

  sudo vi /etc/redis/redis.conf
To allow remote access to the redis instance.
   bind 0.0.0.0
Set password in Redis
  requirepass devopsroles.com
Add a pid file.
  pidfile /var/run/redis/redis-server.pid
Set Persistent Store for Recovery
   appendonly yes
   appendfilename "appendonly.aof"
Restart to apply changes:
  sudo systemctl restart redis
Connecting to redis locally, check redis information as commnad below
  $ redis-cli
  127.0.0.1:6379> auth devopsroles.com
  127.0.0.1:6379> INFO
How to install configure Redis on Rocky Linux / Centos 8
 

Performing Redis Benchmarking against local redis to test its performance. For example, run the benchmark with 20 parallel connections

  $ redis-benchmark -h 127.0.0.1 -p 6379 -n 10000 -c 20 -a devopsroles.com

 How to install configure Redis on Rocky Linux / Centos 8

Conclusion

After completing these steps, you will have successfully installed and configured Redis on Rocky Linux / CentOS 8. Testing and benchmarking Redis ensures your system operates efficiently and reliably. With Redis, you can leverage powerful features to enhance performance and scale your applications. thank you for reading the huuphan.com page!

Comments

Popular posts from this blog

zimbra some services are not running [Solve problem]

Bash script list all IP addresses connected to Server with Country Information

Zimbra Client host rejected Access denied fixed