1.下载Redis并解压
去reids官网下载看一下最新的版本 http://download.redis.io/releases
$ wget http://download.redis.io/releases/redis-5.0.7.tar.gz
$ tar xzf redis-5.0.7.tar.gz
2.安装GCC依赖
yum install gcc
3.编译安装
$ cd redis-5.0.7
$ make MALLOC=libc
cd src && make install
中间会出现一些特殊情况:
如果make的时候提示如下错误:
cc: error: ../deps/hiredis/libhiredis.a: No such file or directory
cc: error: ../deps/lua/src/liblua.a: No such file or directory
cc: error: ../deps/jemalloc/lib/libjemalloc.a: No such file or directory
make: * [redis-server] Error 1
则进入redis下的deps下的运行如下命令,就OK了。
make lua hiredis linenoise
如果make test 出现下面错误
make[1]: Entering directory /root/redis-3.0.2/src'
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] Error 1
make[1]: Leaving directory/root/redis-3.0