How to install Redis server on CentOS 8
[[email protected] ~]# dnf list all | grep ^redis
redis.x86_64 5.0.3-2.module_el8.2.0+318+3d7e67ea AppStream
redis-devel.x86_64 5.0.3-2.module_el8.2.0+318+3d7e67ea AppStream
redis-doc.noarch 5.0.3-2.module_el8.2.0+318+3d7e67ea AppStream
[[email protected] ~]#
https://www.youtube.com/watch?v=db7iWl5__lQ
[[email protected] ~]# dnf install redis
Last metadata expiration check: 0:01:42 ago on Mon 07 Sep 2020 05:56:36 PM IST.
Dependencies resolved.
=============================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================
Installing:
redis x86_64 5.0.3-2.module_el8.2.0+318+3d7e67ea AppStream 925 k
Enabling module streams:
redis 5
Transaction Summary
=============================================================================================================================================
Install 1 Package
Total download size: 925 k
Installed size: 3.2 M
Is this ok [y/N]: y
Downloading Packages:
redis-5.0.3-2.module_el8.2.0+318+3d7e67ea.x86_64.rpm 1.5 MB/s | 925 kB 00:00
———————————————————————————————————————————————
Total 729 kB/s | 925 kB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: redis-5.0.3-2.module_el8.2.0+318+3d7e67ea.x86_64 1/1
Installing : redis-5.0.3-2.module_el8.2.0+318+3d7e67ea.x86_64 1/1
Running scriptlet: redis-5.0.3-2.module_el8.2.0+318+3d7e67ea.x86_64 1/1
Verifying : redis-5.0.3-2.module_el8.2.0+318+3d7e67ea.x86_64 1/1
Installed products updated.
Installed:
redis-5.0.3-2.module_el8.2.0+318+3d7e67ea.x86_64
Complete!
[[email protected] ~]#
[[email protected] ~]# grep overcommit_memory /etc/sysctl.conf
[[email protected] ~]#
[[email protected] ~]# vim /etc/sysctl.conf
[[email protected] ~]# grep overcommit_memory /etc/sysctl.conf
[[email protected] ~]# vm.overcommit_memory = 1
[[email protected] ~]# sysctl vm.overcommit_memory=1
vm.overcommit_memory = 1
[[email protected] ~]#
[[email protected] ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
[[email protected] ~]#
[[email protected] ~]# ls -lahd /etc/redis.conf
-rw-r—– 1 redis root 61K May 7 07:52 /etc/redis.conf
[[email protected] ~]#
[[email protected] ~]# cp /etc/redis.conf /etc/redis.conf.backup
[[email protected] ~]#
[[email protected] ~]#
[[email protected] ~]# vim /etc/redis.conf
[[email protected] ~]#
[[email protected] ~]#
[[email protected] ~]# systemctl status redis
● redis.service – Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; disabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: inactive (dead)
[[email protected] ~]#
[[email protected] ~]# systemctl start redis
[[email protected] ~]#
[[email protected] ~]# systemctl enable redis
Created symlink /etc/systemd/system/multi-user.target.wants/redis.service → /usr/lib/systemd/system/redis.service.
[[email protected] ~]#
[[email protected] ~]#
[[email protected] ~]# systemctl status redis
● redis.service – Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: active (running) since Mon 2020-09-07 18:00:36 IST; 6s ago
Main PID: 3858 (redis-server)
Tasks: 4 (limit: 7377)
Memory: 3.2M
CGroup: /system.slice/redis.service
└─3858 /usr/bin/redis-server 127.0.0.1:6379
Sep 07 18:00:35 server.the-d2.com systemd[1]: Starting Redis persistent key-value database…
Sep 07 18:00:36 server.the-d2.com systemd[1]: Started Redis persistent key-value database.
[[email protected] ~]#
[[email protected] ~]#
[[email protected] ~]# netstat -plunt | grep redis
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 3858/redis-server 1
[[email protected] ~]#
[[email protected] ~]# redis-cli
127.0.0.1:6379> client list
id=3 addr=127.0.0.1:41420 fd=7 name= age=3 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=26 qbuf-free=32742 obl=0 oll=0 omem=0 events=r cmd=client
127.0.0.1:6379>
127.0.0.1:6379> exit
[[email protected] ~]#
[[email protected] ~]# less /var/log/redis/redis.log
[[email protected] ~]#
[[email protected] ~]#
[[email protected] ~]# redis-server -v
Redis server v=5.0.3 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=28849dbea6f07cc8
[[email protected] ~]#