Install and Setup Redis

Download and Untar Redis Installer

# wget http://download.redis.io/releases/redis-2.8.3.tar.gz
# tar -xzvf redis-2.8.3.tar.gz

Install GCC & TCL (if not yet)

# yum install gcc tcl

Enter Directory and Make

# cd redis-2.8.3
# make
# make install

Enter Utils Directory and vi install_server.sh file
# cd utils

if you would like to install without _PORT on all files:

# cp install_server.sh install_server.sh.bak
# vi install_server.sh
replace all "_$REDIS_PORT" with empty string ""
e.g. _REDIS_LOG_FILE="/var/log/redis_$REDIS_PORT.log" will change to -> /var/log/redis.log

# to change redis configuration file location after installation:

_REDIS_CONFIG_FILE="/etc/redis/$REDIS_PORT.conf" change to-> /etc/redis/redis.conf

#to change the redis data directory

_REDIS_DATA_DIR="/var/lib/redis/$REDIS_PORT" change to -> /data/redis

Install Redis Server

# ./install_server.sh

If you have changed the redis configuration file name, redis data directory before running install_server.sh, you will need to correct the file content for startup script:

# vi /etc/init.d/redis

Edit File (so that service stop won’t hang)
# vi /etc/init.d/redis_$REDIS_PORT or /etc/init.d/redis
Add HOST=”xx.x.x.xx” (internal IP) under REDISPORT
Add PW=”xxxxxxx” (password) under HOST
Edit and add HOST, PW directive to:
$CLIEXEC -h $HOST -p $REDISPORT -a $PW shutdown

Non Standard Directory Path:

/etc/redis/redis.conf
/data/redis
/var/log/redis.log
/etc/init.d/redis
/usr/redis-2.8.3

Standard Installation Path:

/etc/redis/redis_$REDIS_PORT.conf
/var/lib/redis/$REDIS_PORT
/var/log/redis_$REDIS_PORT.log
/etc/init.d/redis_$REDIS_PORT
/usr/redis-2.8.3

Command

# service redis start | stop

Be the first to comment

Leave a Reply

Your email address will not be published.


*