环境
安装过程
$ wget http://download.redis.io/releases/redis-3.2.1.tar.gz
$ cd redis-3.2.1
$ make
$ make PREFIX=/usr/local/redis install
$ mkdir -p /usr/local/redis/etc/
$ cp redis.conf /usr/local/redis/etc/
过程中其他问题说明:
1. 在安装的过程中,会提示:`Hint: It's a good idea to run 'make test' ;)`。
2. 当运行`make test` 会提示:`You need tcl 8.5 or newer in order to run the Redis test`
该提示是提醒需要安装tcl扩展,可以忽略,不安装,也能正常运行
redis启动、关闭
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf //服务启动
/usr/local/redis/bin/redis-cli shutdown //关闭redis服务
其他配置
- 默认情况下,redis不是作为后台守护进程运行的,即运行redis的时候,命令行窗口会被占用,一直显示redis服务在运行,如果需要后台运行,就要在配置文件:
/usr/local/redis/etc/redis.conf中,将daemonize no改为daemonize yes即可。
客户端软件:
参考说明