操作系统:Derived from Red Hat Enterprise Linux 7.1 (Source
Redis版本:redis-6.0.5
gcc版本:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-9/root/usr --mandir=/opt/rh/devtoolset-9/root/usr/share/man --infodir=/opt/rh/devtoolset-9/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-9.1.1-20190605/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 9.1.1 20190605 (Red Hat 9.1.1-2) (GCC)
安装redis报错,提示错误行是41,打开tests/integration/replication.tcl文件看41行是注释。。
31 test {Slave enters handshake} {
32 wait_for_condition 50 1000 {
33 [string match *handshake* [$slave role]]
34 } else {
35 fail "Replica does not enter handshake state"
36 }
37 }
38
39 # But make the master unable to send
40 # the periodic newlines to refresh the connection. The slave
41 # should detect the timeout.
42 $master debug sleep 10
43
44 test {Slave is able to detect timeout during handshake} {
45 wait_for_condition 50 1000 {
46 [log_file_matches $slave_log "*Timeout connecting to the MASTER*"]
47 } else {
48 fail "Replica is not able to detect timeout"
49 }
50 }
51 }
52 }
在网上排查类似的错误,一般是修改参数解决,于是修改了45行的参数,将原来的50改成了100
44 test {Slave is able to detect timeout during handshake} {
45 wait_for_condition 100 1000 {
46 [log_file_matches $slave_log "*Timeout connecting to the MASTER*"]
47 } else {
48 fail "Replica is not able to detect timeout"
49 }
50 }
重新编译后提示成功。
\o/ All tests passed without errors!
Cleanup: may take some time... OK
make[1]: Leaving directory `/home/redis/redis-6.0.5/src'
后面又把这个参数改回到50,也成功了,原因就不知道了