redis-master slave设置失败

时间:2017-08-20 16:08:56

标签: redis

我已经启动服务器端口6001作为主服务器,持久性aof关闭,从服务器端口6002作为6001的主服务器。但是在启动slave时我在无限循环中得到以下错误也注意能够找到任何错误日志相同..

Slave infinite loop logs : 

[5556] 20 Aug 21:34:28.499 # Server started, Redis version 3.2.100
[5556] 20 Aug 21:34:28.500 * DB loaded from disk: 0.001 seconds
[5556] 20 Aug 21:34:28.500 * The server is now ready to accept connections on port 6002
[5556] 20 Aug 21:34:28.501 * Connecting to MASTER localhost:6001
[5556] 20 Aug 21:34:28.513 * MASTER <-> SLAVE sync started
[5556] 20 Aug 21:34:29.513 * Non blocking connect for SYNC fired the event.
[5556] 20 Aug 21:34:29.513 # Sending command to master in replication handshake: -Writing to master: Unknown error
[5556] 20 Aug 21:34:29.516 * Connecting to MASTER localhost:6001
[5556] 20 Aug 21:34:29.517 * MASTER <-> SLAVE sync started

1 个答案:

答案 0 :(得分:0)

问题已解决,redis.conf包含127.0.0.1作为绑定值,而从slave redis.conf文件,我有SLAVE OF localhost。用127.0.0.1替换localhost解决了问题