Redis本身的複製是不穩定的,當slave逾時後會執行一次resync,會導致master即使在未開持久化的情況下執行bgsave,並將snapshot發送到slave後建立複製流;那麼在這種情況下比較推薦的拓撲就是鏈式複製,而不是一對多,否則當網路環境抖動時會對master產生很大的負載以及網卡壓力;
Redis關於partitial resync還在測試當中,據說2.8會release,不會按照MySQL binlog的那種方式:
MySQL is one of the first databases I get exposed for sure, a few decades ago, and the first time I had to setup replication I was shocked about how much it sucked. Are you serious that I need to enable binary logs and deal with offset?
Redis replication, that everyone agrees is dead-simple tosetup, is more or less a response to how much I dislike MySQL replication fromthe point of view of the "user interface".
Even if we needed partial replicaton, I didn't wantedRedis to be like that.
據說新浪改寫了redis的replication,產用類似MySQL的方式:P);
具體細節參考Redis的作者blog:
Design:http://antirez.com/news/31
http://antirez.com/news/45
PSYNC: http://antirez.com/news/47
本文出自 “MIKE老畢的部落格” 部落格,請務必保留此出處http://boylook.blog.51cto.com/7934327/1299880