$ cat /var/log/redis/redis.log 14015:S 13 May 2020 17:08:24.047 * Connecting to MASTER 192.168.15.68:6379 14015:S 13 May 2020 17:08:24.048 * MASTER <-> REPLICA sync started 14015:S 13 May 2020 17:08:24.049 # Error condition on socket for SYNC: No route to host
14015:S 13 May 2020 17:08:24.047 * Connecting to MASTER 192.168.15.68:6379 14015:S 13 May 2020 17:08:24.048 * MASTER <-> REPLICA sync started 14015:S 13 May 2020 17:08:24.049 # Error condition on socket for SYNC: Connection refused
14015:S 13 May 2020 17:08:24.049 # Error condition on socket for SYNC: Connection refused 14015:S 13 May 2020 17:08:25.050 * Connecting to MASTER 192.168.15.68:6379 14015:S 13 May 2020 17:08:25.050 * MASTER <-> REPLICA sync started 14015:S 13 May 2020 17:08:25.140 * Non blocking connect for SYNC fired the event. 14015:S 13 May 2020 17:08:25.141 * Master replied to PING, replication can continue... 14015:S 13 May 2020 17:08:25.144 * Partial resynchronization not possible (no cached master) 14015:S 13 May 2020 17:08:25.146 * Full resync from master: c658aa4725c9200d910e7704e58a44bf36a57e28:0 14015:S 13 May 2020 17:08:25.233 * MASTER <-> REPLICA sync: receiving 224 bytes from master 14015:S 13 May 2020 17:08:25.234 * MASTER <-> REPLICA sync: Flushing old data 14015:S 13 May 2020 17:08:25.234 * MASTER <-> REPLICA sync: Loading DB in memory 14015:S 13 May 2020 17:08:25.234 * MASTER <-> REPLICA sync: Finished with success
slave 验证数据是否同步:
1 2 3 4 5 6 7 8 9
$ redis-cli 127.0.0.1:6379> keys * 1) "to-slave" 2) "hello" 127.0.0.1:6379> get hello "world" 127.0.0.1:6379> get to-slave "hello this is master" 127.0.0.1:6379>