1.下载&安装
官方文档:http://www.redis.cn/download.html
$ wget http://download.redis.io/releases/redis-4.0.10.tar.gz$ tar xzf redis-4.0.10.tar.gz$ cd redis-4.0.10$ make
执行 make 报错:GCC:command not found
make编译如果失败,因为没有安装gcc服务yum install gcc
再次执行 报错: jemalloc/jemalloc.h: no such file ........
make MALLOC=libc
运行 make test 报错:You need tcl 8.5 or newer in order to run the Redis test
yum install tcl
安装完成
2.修改配置文件:
默认情况,Redis不是在后台运行,我们需要把redis放在后台运行 vim /redis.conf
让redis开机自启 vim /etc/rc.local
添加 /usr/local/redis/bin/redis-server /usr/local/redis/etc/redis-conf
217.0.0.1 改为 0.0.0.0
3.启动Redis
./src/redis-server redis.conf
4.关闭Redis
pkill redis-server
6.测试redis
./src/redis-cli