安装redis
wget http://download.redis.io/releases/redis-3.0.3.tar.gz
yum -y install tcl
安装redis
tar zxvf redis-3.0.3.tar.gz
cd redis-3.0.3
make
make PREFIX=/usr/local/redis install #这里记得PREFIX是大写,小写不生效!
配置redis
cd /usr/local/redis/
mkdir etc var # 创建两个文件夹
cd –
cp redis.conf /usr/local/redis/etc/
编辑 /usr/local/redis/etc/redis.conf
修改 daemonize 为yes.
注释掉以下内容:
save 900 1
save 300 10
save 60 10000
cp utils/redis_init_script /etc/init.d/redis
vim /etc/init.d/redis #编辑启动脚本
REDISPORT=6379
EXEC=/usr/local/redis/bin/redis-server #修改路径
CLIEXEC=/usr/local/redis/bin/redis-cli #修改路径
PIDFILE=/var/run/redis.pid #修改文件名,要和配置文件redis.conf 一致
CONF=”/usr/local/redis/etc/redis.conf” #修改路径
/etc/init.d/redis start
/etc/init.d/redis stop
查看安装的redis版本信息
Redis server v=3.0.3 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=21b43123f28c39e6