How to install Redis 3.x on new CentOS 6.6 server

Pre installation Redis

#yum -y update
#yum -y upgrade
#Install gcc & tcl, needed for compilation
#yum install -y gcc
#yum install -y tcl wget

Install Redis

#wget http://download.redis.io/releases/redis-3.0.1.tar.gz
#tar xzf redis-3.0.1.tar.gz
#cd redis-3.0.1
#make
#make install

#cd /redis-*/utils
#chmod +x install_server.sh
#./install_server.sh
  
Check Redis status/start/stop

#/etc/init.d/redis_6379 status
#/etc/init.d/redis_6379 start

Set a password (Very Important)

#vi /etc/redis/6379.conf

find requirepass
and replace it with your password

#/etc/init.d/redis_6379 restart

Check if Redis is working

#redis-cli ping
PONG

Now is done.

If you need second instance of Redis 

#cp /etc/redis/6379.conf  /etc/redis/6380.conf 
#vim /etc/redis/6380.conf
 find and change as below:

pidfile /var/run/redis_6380.pid

port 6380

logfile /var/log/redis_6380.log

dir /var/lib/redis/6380

requirepass sdfsdfsfddddddddddd

#cp /etc/init.d/redis_6379  /etc/init.d/redis_6380
#vim /etc/init.d/redis_6380
 find and change as below:

PIDFILE=/var/run/redis_6380.pid
CONF="/etc/redis/6380.conf"
REDISPORT="63780"


Run command for apply second instance of redis

#/usr/local/bin/redis-server /etc/redis/6380.conf 

check status:

#/etc/init.d/redis_6380 status
#/etc/init.d/redis_6380 start


configure redis start auto when reboot:

#vim /etc/rc.local

add:
/usr/local/bin/redis-server /etc/redis/63791.conf

note: no space before word<</usr......>>

Check status port with netstat:

#netstat -tapn | grep redis

tcp    0   0 0.0.0.0:6379          0.0.0.0:*                   LISTEN      16423/redis-server 
tcp    0   0 0.0.0.0:63791        0.0.0.0:*                   LISTEN      16435/redis-server 
tcp    0   0 :::6379                       :::*                        LISTEN      16423/redis-server 
tcp    0   0 :::63791                     :::*                        LISTEN      16435/redis-server 



========================
Reference:
-http://www.systempandit.com/install-redis-on-centos/
-http://linuxtweaks.in/install-redis-redis-server-centosredhat/