标签:redis安装手册
1、下载Redis安装包
下载最新的state版本的二进制包
2、安装
将下载好的安装包拷贝到目标服务器上/srv目录中,执行以下命令安装
# tar zxf redis-3.2.1.tar.gz #make #cd /src #make install
3、创建redis目录
#mkdir -p /usr/local/redis/etc #mkdir -p /usr/local/redis/bin #cp /srv/redis-3.2.1/redis.conf /usr/local/redis/etc/ #cd /srv/redis-3.2.1/src #cp redis-server redis-cli /usr/local/redis/bin/
4、修改配置文件
vim /usr/local/redis/etc/redis.conf
将daemonize no 设置成daemonize yes
5、启动服务
./usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
6、redis服务启动脚本
#!/bin/sh # # redis Startup script for Redis Server # # chkconfig: - 80 12 # description: Redis is an open source, advanced key-value store. # # processname: redis-server # config: /etc/redis.conf # pidfile: /var/run/redis.pid source /etc/init.d/functions BIN="/usr/local/redis/bin" CONFIG="/usr/local/redis/redis.conf" PIDFILE="/var/run/redis.pid" ### Read configuration [ -r "$SYSCONFIG" ] && source "$SYSCONFIG" RETVAL=0 prog="redis-server" desc="Redis Server" start() { if [ -e $PIDFILE ];then echo "$desc already running...." exit 1 fi echo -n $"Starting $desc: " daemon $BIN/$prog $CONFIG RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog return $RETVAL } stop() { echo -n $"Stop $desc: " killproc $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog $PIDFILE return $RETVAL } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; condrestart) [ -e /var/lock/subsys/$prog ] && restart RETVAL=$? ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" RETVAL=1 esac exit $RETVAL
本文出自 “zengestudy” 博客,请务必保留此出处http://zengestudy.blog.51cto.com/1702365/1853801
标签:redis安装手册
原文地址:http://zengestudy.blog.51cto.com/1702365/1853801