从节点服务端启动提示:
9100:S 13 May 2020 18:10:46.302 * Connecting to MASTER 127.0.0.1:6379
9100:S 13 May 2020 18:10:46.302 * MASTER <-> REPLICA sync started
9100:S 13 May 2020 18:10:46.302 * Non blocking connect for SYNC fired the event.
9100:S 13 May 2020 18:10:46.302 * Master replied to PING, replication can continue…
9100:S 13 May 2020 18:10:46.302 * (Non critical) Master does not understand REPLCONF listening-port: -NOAUTH Authentication required.
9100:S 13 May 2020 18:10:46.302 * (Non critical) Master does not understand REPLCONF capa: -NOAUTH Authentication required.
9100:S 13 May 2020 18:10:46.302 * Partial resynchronization not possible (no cached master)
9100:S 13 May 2020 18:10:46.302 # Unexpected reply to PSYNC from master: -NOAUTH Authentication required.
9100:S 13 May 2020 18:10:46.302 * Retrying with SYNC…
9100:S 13 May 2020 18:10:46.302 # MASTER aborted replication with an error: NOAUTH Authentication required.
对于Rdis集群,如果设置了requirepass密码,则一定要设置masterauth密码,否则从节点无法正常工作。实际上“/ect/redis/redis.conf”配置文件里有说明:
replicaof
287
288 # If the master is password protected (using the “requirepass” configuration
289 # directive below) it is possible to tell the replica to authenticate before
290 # starting the replication synchronization process, otherwise the master will
291 # refuse the replica request.
292 #
293 # masterauth
在此给 masterauth 123456 添加密码就OK了!
然后,用设置好的密码方式启动从节点服务:redis-server --port 6300 --slaveof 127.0.0.1 6379 –masterauth 123456
启动成功!!!
从客户端连接服务端,查看是否同步数据成功!