In this post we will see step by step installation of Redis service in Redhat/CentOS operation system.
To install Redis, run this command in terminal
-dnf install redis
This command will install the redis service in your machine.
Verify installation
-systemctl status redis
-systemctl start redis
-systemctl enable redis
Note: Before start redis service set Linux Kernal overcommit memory to 1 by adding vm.overcommit_memory = 1 to /etc/sysctl.conf file.
Why we should do that: As we know redis is in memory data store. It primarily uses RAM to store data. Redis and other processes use RAM memory. We set vm.overcommit_memory = 1 to make sure Kernal not overcommit the memory by allocating memory to new program which required more memory than available memory.
In this scenario OOM (Out Of Memory) killer terminate the rest of processes.
We also restricting Kernal not to terminate the important services running and also stop swapping redis and other importance service to device i/o device, where performance of redis effected.
Create file in /etc/sysctl.conf and add this line
vm.overcommit_memory = 0
Save and close this file than reload the sysctl configurations
-sysctl -p /etc/sysctl.conf
or alternatively
-sysctl --system
check the set value
-sysctl vm.overcommit_memory
Than restart the redis
-systemctl restart redis
Usefull Link: https://infotechys.com/install-and-configure-redis-on-rhel9-centos9/
Comments
Post a Comment