How to install Redis in Centos:ΒΆ

# yum install gcc make
# yum -y install tcl

# cd /opt
# useradd redis
# passwd redis
  1. Download latest from here
# wget http://download.redis.io/releases/redis-3.0.2.tar.gz
  1. To verify sha1sum go here
# sha1sum redis-3.0.2.tar.gz   (compare the output value to above given link redis version)
  1. Extract the tar file
# tar -xzvf redis-3.0.2.tar.gz
# mv redis-3.0.2 redis
# cd redis
# make
 or
# make install

make : will create src folder with different executables make install : will install the redis in /usr/local/bin

make install command will create following executables will be available in /usr/local/bin/ redis-benchmark redis-check-aof redis-check-dump redis-cli redis-sentinel redis-server

# make test

4. Copy redis.conf file to /etc directory now run

# cd src
# ./redis-server ../redis.conf
# ctrl + C

Make script to run it

# mkdir /scripts
# cd scripts
# vi start-redis

Add following

nohup runuser -l redis -c "/opt/redis/src/redis-server /opt/redis/redis.conf" > /tmp/redis.log &

go to /opt/redis/redis.conf

uncomment requirepass and add long pass

requirepass asmdgjsagdjkasgdkasgdkjasdgkasd

save it

start the script

# /scripts/start-redis
# redis-cli

> AUTH asmdgjsagdjkasgdkasgdkjasdgkasd
OK
>ping
PONG
>exit