从数据库1同步到缓存:
- 127.0.0.1:6380> keys *
- 1) "test02"
- 2) "c"
- 3) "d"
- 4) "a"
- 5) "test"
- 6) "kebo"
- 7) "slavetest"
- 8) "b"
- 9) "redisfast"
- 127.0.0.1:6380> get slavetest
- "0851"
重启从数据库2:
- 34855:S 26 Aug 2019 13:34:39.561 * DB loaded from disk: 0.000 seconds
- 34855:S 26 Aug 2019 13:34:39.561 * Before turning into a replica, using my master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
- 34855:S 26 Aug 2019 13:34:39.561 * Ready to accept connections
- 34855:S 26 Aug 2019 13:34:39.561 * Connecting to MASTER 127.0.0.1:6379
- 34855:S 26 Aug 2019 13:34:39.561 * MASTER <-> REPLICA sync started
- 34855:S 26 Aug 2019 13:34:39.561 * Non blocking connect for SYNC fired the event.
- 34855:S 26 Aug 2019 13:34:39.561 * Master replied to PING, replication can continue...
- 34855:S 26 Aug 2019 13:34:39.562 * Trying a partial resynchronization (request d41f950be7593a93620b1fd872b7552668f0b355:888).
- 34855:S 26 Aug 2019 13:34:39.562 * Successful partial resynchronization with master.
- 34855:S 26 Aug 2019 13:34:39.562 * MASTER <-> REPLICA sync: Master accepted a Partial Resynchronization.
从库启动后,加载本地数据,开始向主数据库进行请求同步,这里同步起点是根据从数据库的offset开始。 (编辑:西安站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|