1、获取安装文件
$ pwd
/user/***
$ wget http://download.redis.io/releases/redis-3.2.3.tar.gz
2、解压文件并移动文件
$ tar xzf redis-3.2.3.tar.gz
$ mv redis-3.2.3 /usr/local/redis
3、进入文件夹目录
$ cd /usr/local/redis
4、编译安装
$ make
5、安装依赖包
$ cd src && make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] 错误 1
$ yum install tcl
已加载插件:fastestmirror, security
设置安装进程
Loading mirror speeds from cached hostfile
.............
6、再次编译安装
$ make
$ cd src
$ make test
7、make test报错及修改
[err]: Test replication partial resync: ok psync (diskless: yes, reconnect: 1) in tests/integration/replication-psync.tcl
Expected condition '[s -1 sync_partial_ok] > 0' to be true ([s -1 sync_partial_ok] > 0)
出现这个问题的缘由多是"测试点在配置比较低的机器上会由于超时而过不了"
在解压目录中修改
# vi tests/integration/replication-psync.tcl
把 after 100 改为 after 500
8、设置配置文件路径
$ mkdir /etc/redis
$ cp /usr/local/redis/redis.conf /etc/redis
9、加入开机启动
echo "/usr/local/redis/src/redis-server /etc/redis/redis.conf &" >> /etc/rc.local
10、启动redis-server 及redsi-cli
$ /usr/local/redis/src/redis-server /etc/redis/redis.conf &
$ /usr/local/redis/src/redis-cli