In this tutorial, How to learn install configure Redis on rocky Linux / Centos 8.
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 updateStep 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.rpmList redis using command below
sudo dnf module list redis
Enable redis 6
sudo dnf module enable redis:remi-6.2 -y
In Redis Server.
sudo dnf install redis
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.confTo allow remote access to the redis instance.
bind 0.0.0.0Set password in Redis
requirepass devopsroles.comAdd a pid file.
pidfile /var/run/redis/redis-server.pidSet Persistent Store for Recovery
appendonly yesRestart to apply changes:
appendfilename "appendonly.aof"
sudo systemctl restart redisConnecting 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
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