1. newly build redis Folder
mkdir /home/redis
2. Get into redis Catalog
cd /home/redis
3. download redis-5.0.8
wget http://download.redis.io/rele...
4. decompression redis
tar zxvf redis-5.0.8.tar.gz
5. Get into redis-5.0.8
cd /home/reids/redis-5.0.8/src
6. compile ( Make sure to install before compiling gcc, If not installed yum install gcc)
make
7. To configure redis
8. Set up redis Start for power on
New startup script
vi /etc/init.d/redis
Enter startup script :
#chkconfig: 2345 10 90
# description: Start and Stop redis
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.
REDISPORT=6379
EXEC=/home/redis/redis-5.0.8/src/redis-server
CLIEXEC=/home/redis/redis-5.0.8/src/redis-cli
PIDFILE=/var/lib/redis/redis_${REDISPORT}.pid
#CONF="/etc/redis/${REDISPORT}.conf"
CONF="/home/redis/redis-5.0.8/redis.conf"
case "$1" in
start)
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed"
else
echo "Starting Redis server..."
$EXEC $CONF &
fi
;;
stop)
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE does not exist, process is not running"
else
PID=$(cat $PIDFILE)
echo "Stopping ..."
$CLIEXEC -p $REDISPORT shutdown
while [ -x /proc/${PID} ]
do
echo "Waiting for Redis to shutdown ..."
sleep 1
done
echo "Redis stopped"
fi
;;
restart)
"$0" stop
sleep 3
"$0" start
;;
*)
echo "Please use start or stop or restart as first argument"
;;
esac
9. add to redis service
chkconfig --add redis
10. Set to boot
chkconfig redis on
11. Start the service
nohup service redis start