Friday, August 19, 2016

Redis Installation Centos

Redis Installation Centos

Step-1

If gcc already installed ignore or else install
# yum install make gcc

Step 2

Download to location   /tmp or somewhere else
# wget http://redis.io/download    Redis latestversion .gz  file

#tar –xf  Redis-version ****.tar.gz

Step-3

Now we are ready to install Redis from the source.
# cd redis ****
# make
# make install

Step 4

Move all of the redis executable files to the /opt directory by issuing the following sequence of commands:
cp /opt/redis/redis.conf /opt/redis/redis.conf.default

cp /opt/redis/src/redis-benchmark /opt/redis/

cp /opt/redis/src/redis-cli /opt/redis/

cp /opt/redis/src/redis-server /opt/redis/

cp /opt/redis/src/redis-check-aof /opt/redis/

cp /opt/redis/src/redis-check-dump /opt/redis/




Step-5

Redis Configuration
All Redis configuration options can be specified in the redis.conf file located at /opt/redis/redis.conf. Issue the following command to create this file from the default configuration file:
cp /opt/redis/redis.conf.default  /opt/redis/redis.conf
 
Consider the following Configuration
File :  redis.conf
1.    daemonize  yes

2.    pidfile  /var/run/redis.pid

3.    port 6379

4.    bind 127.0.0.1    (uncomment)

5.    timeout 300

6.    databases 16

7.    save 900 1
save 300 10
save 60 10000

8.    rdbcompression  yes

# The filename where to dump the DB
9.    dbfilename /opt/redis/db/dump.rdb  ( need to notify  db path)

# The working directory.
10.  dir /opt/redis/    (need to Specify Dir  Here) 

11.  appendonly no

12.  logfile "/var/log/redis.log"



  

Step 6

Deploy init Script

Get code from below   its an example
http://www.linode.com/docs/assets/631-redis-init-rpm.sh
 
 
 Changes need to be done according to your Conf in the script file
 
               # Touch /var/log/redis.log
 
                               # Chkconfig --add redis
 
                                              # Chkconfig redis on

Step -7

Redis will  Now start  with following commands
# /etc/init.d/redis start
 
# /etc/init.d/redis  stop

Step-8

# /opt/redis/redis-cli

Source  :

No comments:

Post a Comment