问题1:
linux CentOS6下安装redis报错 make[1]: *** [adlist.o] 错误 127。[安装gcc]
解决方案:
因为Redis是C实现的,需要gcc来进行编译,所以原因是系统未安装gcc,按顺序执行:
yum install cpp
yum install binutils
yum install glibc
yum install glibc-kernheaders
yum install glibc-common
yum install glibc-devel
yum install gcc
yum install make
因为gcc依赖很多,都执行一下,以防万一
问题2:
cd src && make all
make[1]: Entering directory `/root/install_packages/redis3.0/src'
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 `/root/install_packages/redis3.0/src'
make: *** [all] 错误 2
解决方案:
执行命令:make MALLOC=libc
问题3:
[root@node1 redis3.0]# make test
cd src && make test
make[1]: Entering directory `/root/install_packages/redis3.0/src'
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] 错误 1
make[1]: Leaving directory `/root/install_packages/redis3.0/src'
make: *** [test] 错误 2
解决方案:yum install tcl
问题4:
!!! WARNING The following tests failed:
*** [err]: PEXPIRE/PSETEX/PEXPIREAT can set sub-second expires in tests/unit/expire.tcl
Expected 'somevalue {}' to equal or match '{} {}'
Cleanup: may take some time... OK
make[1]: *** [test] 错误 1
make[1]: Leaving directory `/root/install_packages/redis3.0/src'
make: *** [test] 错误 2
解决方案:
vim修改tests/unit/expire.tcl文件:
tags {"slow"} {
test {EXPIRE - After 2.1 seconds the key should no longer be here} {
after 21000
list [r get x] [r exists x]
} {{} 0}
}
test {EXPIRE - write on expire should work} {
r del x
r lpush x foo
r expire x 10000
r lpush x bar
r lrange x 0 -1
} {bar foo}