HugeServer Knowledgebase

How to install Redis 3.2 on CentOS 6 and 7

What is Redis?

Redis is a flexible open-source, key-value data store, used as a database, cache and message broker. Redis allows the user to store vast amounts of data without the limits of a relational database.
In order to achieve its outstanding performance, Redis works with an in-memory dataset. Depending on your use case, you can persist it either by dumping the dataset to disk every once in a while or by appending each command to a log. Persistence can be optionally disabled if you just need a feature-rich, networked, in-memory cache.

Redis Logo

We are assuming that you have root permission, otherwise, you may start commands with “sudo”.

Install necessary packages

On CentOS 6:

yum install wget make gcc tcl

On CentOS 7

yum install wget make gcc

Install Redis 3.2

For installing Redis 3.2 you have to download the source file and compile it because Redis 3.2 is not available in any repository yet.

On CentOS 6 and CentOS 7

wget http://download.redis.io/releases/redis-3.2.8.tar.gz

Now you have to extract the file that you just downloaded by typing:

tar -xvzf redis-3.2.8.tar.gz

Change directory with the command below:

cd redis-3.2.8

It’s time to compile your Redis step by step:

cd deps
make hiredis lua jemalloc linenoise
make geohash-int

Now run below command to get back to the parent directory and run the next command:

cd ../
make
make install

And for getting sure running a test:

make test

It’s going to take a few minutes, you can check that everything is ok.

Install init script

In this section, we are going to install “init script” to manage the process of Redis.

cd utils

./install_server.sh

You will be prompt for some configuration you can hit “Enter” to accept all the default values or you can set yours.

Finally, your Redis server is installed and you can start the service by the command below:

For CentOS 6

service redis_6379 start

For CentOS 7

systemctl start redis_6379

If you want to test your Redis server you can easily use the instruction below:

redis-cli
> set test "HugeServer"
> get test

The answer should be “HugeServer”

If you need a control panel for your Redis Server you may use Phpredmin or Redmon

You can find out more about Redis on its official website!

Was this tutorial helpful?

Thank you for your vote.Thank you for your vote.

Similar Posts

3 thoughts on “How to install Redis 3.2 on CentOS 6 and 7”

Leave a Reply

Your email address will not be published. Required fields are marked *

*