Update Yum
First start by updating your system to keep other packages up to date with yum update.
Extra Packages for Enterprise Linux(EPEL)
Redis server is not in the default repository on a standard CentOS7 install, so we need to install the EPEL package to get access to more packages.
After installing epel, you need to run yum update again.
Install Redis Server Package
Now that the EPEL has been added a simple yum install command will install the redis server software.
After installation you will have redis-server and redis-cli commands in your system. And also you can see a redis service has been installed
Start the Redis Server
Even though technically you can start a redis server using the inbuilt commands, lets use the service that is provided with CentOS to do the start, stop and status of redis server on the system.
It should be running now, check it with status command:
Storing and Retrieving Data
Ok, now that Redis is running, lets start with a trivial example and store a key and value pair and then see how to query it. We will use redis-cli with default options which will connect to a server on localhost and the default redis port. Also note in the real world, you should consider setting up proper security to your Redis instances.
We will use the set and get commands in order to store a key value pair in the server. Here is a screen shot of an example:
You can also use the inline help to get a list of all the possible commands and the help text with them. Enter interactive mode from the redis-cli and then type help as shown below:
Redis: More information
For more information check out the following links below: