Redis NoSQL server installation on CentOS 7 Linux

Spread the love

In this tutorial, we will look into the Installation and configuration of Redis NoSQL Server. We will also discuss running Redis on External interfaces and Connect external Applications to Redis server and Whitelist the External IP addresses using IP Tables.

REDIS Server Installation On CentOS 7

REDIS Installation:

Redis Server is available under EPEL repositories, So, first of all, add the EPEL repository to CentOS.

Now update the yum cache  and install the REDIS Server using the following yum command.

Redis Configuration File is located at /etc/redis.conf

Starting and Stopping  the REDIS server :

Starting :

Stopping:

Restarting :

Test the Installation:

Let’s check if the Redis server is up and running using following ps command.

Output :

We can also test the Redis server connection using   redis-cli  ( Redis Command line interface client )

The following command will send the ping  message to REDIS server. If the server responds with PONG ., Then your installation is successful.

Running Redis on External IP Address or on All Interfaces :

Change the bind IP Address to whatever IP you want or Simply specify 0.0.0.0  to listen on all interfaces.

Connect to Remote Redis on IP Address :

Redis Allow remote connections from SINGLE IP ADDRESS :

Following commands will add one IPTables rule to whitelist the Specified IP Address.

Before doing this, We need to make sure Redis is running on External IP address. So make the following changes in /etc/redis.conf 

Now whitelist the external IP address using the following command.

Testing Redis Server connection from Remote client :

To connect to the remote Redis Server we need to install the Redis-CLI. Redis-CLI is available under the redis-tools package. So go ahead and install the redis-tools package using the following command.

Ubuntu and Debian users :

Now Connect to the Remote Redis using the following command.

Example Connection :

 

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer, Presently working as a Software Engineer. I love Linux and Open Source. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply