wget http://download.redis.io/releases/redis-2.8.1.tar.gz
tar -xvf redis-2.8.1.tar.gz
cd redis-2.8.1
make
mkdir -p /usr/local/redis/var
cd src
cp redis-server redis-sentinel redis-cli redis-check-dump redis-check-aof redis-benchmark /usr/local/redis/
#设置redis进程为后台守护进程:
#sed -i "s/daemonize no/daemonize yes/g" /etc/redis.conf
redis.conf
daemonize yes
pidfile /usr/local/redis/var/redis.pid
port 6379
timeout 300
loglevel debug
logfile /usr/local/redis/var/redis.log
databases 16
save 900 1
save 300 10
save 60 10000
dbfilename dump.rdb
dir /usr/local/redis/var/
appendonly no
start.sh
#!/bin/sh
./redis-server ./redis.conf
shutdown.sh
#!/bin/sh
kill -9 `cat ./var/redis.pid`