最近学习王家林老师的大数据蘑菇云行动,要实现将Spark Streaming分析的数据写入到Redis。今天正好开始入手。 一、Ubuntu16安装Redis3.2.1
遇到了不少的问题,其中,make倒是没问题,make test的时候,出现了:
!!! WARNING The following tests failed:
***[err]: Slave should be able to synchronize with the master in tests/integration/replication-psync.tcl
Replication not started.
Cleanup: may take some time... OK
Makefile:215: recipe for target 'test' failed
make[1]: *** [test] Error 1
make[1]: Leaving directory '/home/dyq/Documents/redis-3.2.1/src'
Makefile:6: recipe for target 'test' failed
make: *** [test] Error 2
貌似是没有和master取得同步连接,但是我这不是还没安装的吗?
百度,看到了一片文章,说是用这个命令:make CFLAGS="-march=i686"
但直接就出错了,没办法。
忽略这个错误,直接运行make install吧:
cd src && make install
make[1]: Entering directory '/home/dyq/Documents/redis-3.2.1/src'
Hint: It's a good> INSTALL install install: cannot create regular file '/usr/local/bin/redis-server': Permission denied
Makefile:256: recipe for target 'install' failed
make[1]: *** [install] Error 1
make[1]: Leaving directory '/home/dyq/Documents/redis-3.2.1/src'
Makefile:9: recipe for target 'install' failed
make: *** [install] Error 2
权限?
sudo make
sudo make install
提示错误,要进入src
好的,OK!
\o/ All tests passed without errors!
Cleanup: may take some time... OK
继续出现错误: [exception]: Executing test client: NOREPLICAS Not enough good slaves to write..
NOREPLICAS Not enough good slaves to write.
继续找度娘:
https://my.oschina.net/u/1049845/blog/203370
这篇文章有说明:
在make test中可能会遇到时间相关的失败,比如
Executing test client: NOREPLICAS Not enough good slaves to write..
这种情况下,可以修改文件tests/integration/replication-2.tcl,将after 1000改为after 10000以延长等待时间。 修改,继续出错!
!!! 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 '{} {}'
*** [err]: Slave should be able to synchronize with the master in tests/integration/replication-psync.tcl
Replication not started.
Cleanup: may take some time... OK
Makefile:215: recipe for target 'test' failed
make: *** [test] Error 1
注意看错误信息,注意看错误信息,注意看错误信息! 是修改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}
终于看到了绿色: \o/ All tests passed without errors! 有多少坑!!!
dyq@ubuntu:~/Documents/redis-3.2.1$ sudo make install
cd src && make install
make[1]: Entering directory '/home/dyq/Documents/redis-3.2.1/src'
虚拟机中安装的时候,机器性能不够的话,很容易出现上述错误!换机器或者更换参数,以及在机器不忙的时候进行编译安装,会顺利通过! GIT上的说明:
For timing issues, one test isn't very representative. Did you try running them 5-10 times? Is there anything unusual about your machine (very small memory, very slow, shared, overloaded, etc)? Some of the tests are based on timing, so if the machine can't deliver results in time then tests can't complete properly. (you can manually edit some of the tests to increase the timeout waiting) 在src目录下,输入redis-server,进入熟悉的界面,看提示,配置文件是
29181:C 06 Oct 13:48:16.321 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf 算了吧,还是指定一个配置文件,在上层目录下,有一个redis.conf。