Install Redis Server in CentOS


Apr 10, 2018    Janaki Mahapatra, Installation

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. For Executable path, select the redis executable path [/usr/local/bin/redis-server] 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 > ping
The answer should be “Pong”