redis安装
安装
$ wget http://download.redis.io/releases/redis-3.0.0.tar.gz
$ tar xzf redis-3.0.0.tar.gz
$ cd redis-3.0.0
$ make
$vim redis.conf
修改端口
# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379
添加密码
# use a very strong password otherwise it will be very easy to break.
requirepass your_password
二进制文件编译完成后在src目录下. 运行如下:
$ src/redis-server
使用Redis内建的客户端以交互的方式使用:
$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
编译失败,如更改错误后继续编译仍不通过,可清理一下环境。
make clean
清除之前编译的可执行文件及配置文件。
make distclean
要清除所有生成的文件。
问题总结如下:
$ make
-bash: make: command not found
yum -y install make
$ make
/bin/sh: cc: command not found
yum -y install gcc
$ make test
You need tcl 8.5 or newer in order to run the Redis test
yum -y install tcl
CC adlist.o
在包含自 adlist.c:34 的文件中:
zmalloc.h:50:31: 错误:jemalloc/jemalloc.h:没有那个文件或目录
zmalloc.h:55:2: 错误:#error "Newer version of jemalloc required"
make[1]: *** [adlist.o] 错误 1
make[1]: Leaving directory `/home/redis/redis-2.8.19/src'
make: *** [all] 错误 2
$ make distclean
Hint: It's a good idea to run 'make test' ;)
make[1]: 警告:检测到时钟错误。您的创建可能是不完整的。
make[1]: Leaving directory `/home/redis/redis-2.8.19/src'
make: 警告:检测到时钟错误。您的创建可能是不完整的。