编写版本:v3.5.0
适用版本:v3.5.0+
1、下载地址
http://download.redis.io/releases/redis-3.0.0.tar.gz
或直接命令:
wget http://download.redis.io/releases/redis-3.0.0.tar.gz
2、安装说明
tar -zxvf redis-3.0.0.tar.gz
cd redis-3.0.0
make
mkdir -p /usr/local/redis
# 如果下列文件在根目录
cp redis-server /usr/local/redis
cp redis-benchmark /usr/local/redis
cp redis-cli /usr/local/redis
# 如果下列文件在src目录
cp src/redis-server /usr/local/redis
cp src/redis-benchmark /usr/local/redis
cp src/redis-cli /usr/local/redis
# 复制配置文件
cp redis.conf /usr/local/redis
cd /usr/local/redis
3、设置服务
vi /etc/init.d/redisd
添加以下内容:
#!/bin/bash
# chkconfig: 2345 50 80
# description: redis start ....
c_home=/usr/local/redis
pidfile=/var/run/redis.pid
start() {
echo starting...
cd ${c_home}
./redis-server redis.conf &
}
stop() {
pid=$(cat $pidfile)
echo stoping...
kill -9 ${pid}
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit
设置服务
$ chkconfig --add redisd
$ chkconfig redisd on
4、启动服务
service redisd start
验证是否成:
ps -ef | grep redis
出现上图信息则表示安装成功!
作者:黄春艳 创建时间:2024-05-10 17:24
最后编辑:黄春艳 更新时间:2024-11-15 11:25
最后编辑:黄春艳 更新时间:2024-11-15 11:25