install redis server from source in centos1 min read

Prabhin Prabharkaran Administrator
DevOps Engineer

He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!

follow me

install redis server from source in centos

Hi Techrunnr Readers, this document deals with how to install redis server from source in centos.


Redis, RE-dis is an open-source in-memory data structure project implementing a distributed, in-memory key-value database with optional durability. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, hyperloglogs, bitmaps and spatial indexes

 

Installation

1. Install the dependencies

yum install wget gcc make

2. Download the latest stable redis package

http://download.redis.io/releases/redis-4.0.11.tar.gz

3. Extract and Install Redis

tar -zxf redis-stable.tar.gz
cd redis-stable/
make
make test
make install
mkdir /etc/redis
mkdir -p /var/redis
cp redis.conf /etc/redis/

4. Change your configuration accordingly

#vim /etc/redis/redis.conf

bind 0.0.0.0
or
bind 0.0.0.0
logfile "/var/log/redis.log"
dir /var/redis/

5. Create Service file and add the following lines

vim /etc/systemd/system/redis.service

[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=root
Group=root
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
Type=Forking
[Install]
WantedBy=multi-user.target

6. Verify the installation

service redis start
service redis status
redis-cli

That’s it!!!

© 2018, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points

Related posts

2 Thoughts to “install redis server from source in centos”

  1. Rishad Azeez

    Well explained.
    But using root is not recommended.

    Instead create new user (e.g., redis) and set appropriate permission for directories used by redis is recommended.

    1. Thank your Rishad for valuable comment.

Leave a Reply