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 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
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
Post a Comment