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
Questions Answered
Articles Written
Overall Points
Categories: databaseLinux

Prabhin Prabharkaran

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

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.