Centos7 redis3.2.3 installation process, centos7redis3.2.3
1: install wget: yum install wget
2: Install pip:
1: sudo yum-y install epel-release
2: sudo yum-y install python-pip
3: Install redis:
1: wget -- no-check-certificate http://download.redis.io/releases/redis-3.2.3.tar.gz
2: tar xzf redis-3.2.3.tar.gz
3: Music redis-3.2.3 usr/local/redis-3.2.3
4: cd usr/loacl/redis-3.2.3
5: make
6: Set auto-start upon startup:
1: Set daemonize in redis. conf to yes
2: Set logfile in redis. conf to "/var/log/redis. log"
2: Write the boot script
Vi/etc/init. d/redis
Redis content is:
"""
# Chkconfig: 2345 10 90
# Description: Start and Stop redis
PATH =/usr/local/bin:/sbin:/usr/bin:/bin
REDISPORT = 6379
EXEC =/usr/local/redis-3.2.3/src/redis-server
REDIS_CLI =/usr/local/redis-3.2.3/src/redis-cli
PIDFILE =/var/run/redis. pid
CONF = "/usr/local/redis-3.2.3/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 exists, process is not running ."
Else
PID = $ (cat $ PIDFILE)
Echo "Stopping ..."
$ REDIS_CLI-p $ REDISPORT SHUTDOWN
Sleep 2
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
"""
4: chmod + x/etc/init. d/redis
5:/etc/init. d/redis start
6: Set boot self-start: sudo chkconfig redis on