In this tutorial we will learn, how to install redis server on CentOS 7 / RHEL 7 . The abbreviation of redis is REmote DIctionary Server. It is one the of the most popular open source,advanced key-value cache and store.

Project URL : http://redis.io/

Follow the given below steps to install redis server on CentOS 7 and Red Hat Enterprise Linux 7. Install wget utility

Install wget command

yum install wget

Install EPEL repo

First we will install the EPEL repo.

Because our system has x86_64 Operating System architecture, we will use only epel repo package for x86_64 . Search epel repo package as per your Operating System architecture(EPEL URL)

wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/e/

rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-*.rpm

It will create two epel’s repo file inside /etc/yum.repos.d These are – 1. epel.repo 2.epel-testing.repo

[root@localhost ~]# ls -l /etc/yum.repos.d/
total 28
-rw-r--r--. 1 root root 1612 Jul  4 07:00 CentOS-Base.repo
-rw-r--r--. 1 root root  640 Jul  4 07:00 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1331 Jul  4 07:00 CentOS-Sources.repo
-rw-r--r--. 1 root root  156 Jul  4 07:00 CentOS-Vault.repo
-rw-r--r--. 1 root root  957 Sep  2 12:14 epel.repo
-rw-r--r--. 1 root root 1056 Sep  2 12:14 epel-testing.repo
[root@localhost ~]#

If you are running CentOS 6 install the following repo instead:

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Install redis server

Now use yum command to install redis server

yum install redis

Two important redis server configuration file’s path 1. /etc/redis.conf 2. /etc/redis-sentinel.conf

Now start the redis server after this.

systemctl start redis.service

Check the running status of redis server

systemctl status redis.service

To test the installation of Redis, use below given command

redis-cli ping

If the response output is PONG, it means installation is completed successfully.

[root@localhost ~]# redis-cli ping
PONG
[root@localhost ~]#

Start/Stop/Restart/Status and Enable redis server

To start redis server

systemctl start redis.service

To stop redis server

systemctl stop redis.service

To restart redis server

systemctl restart redis.service

To get running status of redis server

systemctl status redis.service

To enable redis server at system’s booting time.

systemctl enable redis.service

To disable redis server at system’s booting time.

systemctl disable redis.service

Listening Port Of Redis Server

Redis Server listens by default at port number 6379. Use below given ss command. (To learn more about ss command)

[root@localhost ~]# ss -nlp|grep redis
tcp    LISTEN     0      128            127.0.0.1:6379                  *:*      users:(("redis-     server",19706,4))
[root@localhost ~]#

Note: On minimal installed CentOS 7/ RHEL 7,you wont get netstat command. Instead of netstat command, use ss command which is by default available on system.


This article was last modified: April 24, 2017, 11:10 a.m.

0 Comments

Please log in to leave a comment.

Add or change tags.

A comma-separated list of tags.

Share

Hacker News

Top