#tar -xvf redis.3.2.5.tar.gz –C /usr/local/#cd /usr /local/#mv redis.3.2.5 redis#cd redis#make && make install #cp /usr/local/redis/redis.conf /data/redis/conf#vim /data/redis/conf/redis.conflogfile " /data/logs/redis/redis.log"dir "/data/redis/data"daemonize yesmaxmemory 104857600 Maximum limit of 100M memory mkdir –p /data/redis/conf/mkdir –p /data/logs/redis/mkdir –p /data/redis/data write startup file Vim /etc/init.d/redis# chkconfig: 2345 90 10# description: Redis is a persistent key-value databasePATH=/usr/local/redis/bin:$PATH REDISPORT=6379 EXEC=/usr/local/redis/bin/redis-serverREDIS_CLI=/usr/local/redis/bin/redis-cli PIDFILE=/var/run/redis_6379.pidCONF="/data/redis/conf/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 if ["$?"= "0"] then echo "Redis is ru nning..." fi ;; stop) if [! -f $PIDFILE] then echo "$PIDFILE does not exist, process is not running" else PID=$(cat $PIDFILE) echo "Stopping ..." $REDIS_CLI -p $REDISPORT SHUTDOWN while [-x ${PIDFILE}] do echo "Waiting for Redis to shutdown ..." sleep 1 done echo "Redis stopped" fi ;; restart|force-reload) ${0} stop ${ 0} start ;; *) echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2 exit 1 esac# chkconfig redis on
p>
#tar -xvf redis.3.2.5.tar.gz –C /usr/local/#cd /usr/local/#mv redis .3.2.5 redis#cd redis#make && make install #cp /usr/local/redis/redis.conf /data/redis/conf#vim /data/redis/conf/redis.conflogfile "/data/logs/redis /redis.log"dir "/data/redis/data"daemonize yesmaxmemory 104857600 Maximum limit of 100M memory mkdir –p /data/redis/conf/mkdir –p /data/logs/redis/mkdir –p /data/redis/data Write Startup file Vim /etc/init.d/redis# chkconfig: 2345 90 10# description: Redis is a persistent key-value databasePATH=/usr/local/redis/bin:$PATH REDISPORT=6379 EXEC=/usr/local/ redis/bin/redis-serverREDIS_CLI=/usr/local/redis/bin/redis-cli PIDFILE=/var/run/redis_6379.pidCONF="/data/redis/conf/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 if ["$?"="0"] then echo " Redis is running..." fi ;; stop) if [! -F $PIDFILE] then echo "$PIDFILE does not exist, process is not running" else PID=$(cat $PIDFILE) echo "Stopping ..." $REDIS_CLI -p $REDISPORT SHUTDOWN while [-x ${PIDFILE}] do echo "Waiting for Redis to shutdown ..." sleep 1 done echo "Redis stopped" fi ;; restart|force-reload) ${0} stop ${0} start ;; *) echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2 exit 1 esac# chkconfig redis on
p>