Redis replication config

廉价感情. 提交于 2019-12-19 11:23:38

问题


I have a redis master setup with 2 slaves and a sentinal on each.

If the master goes down for say 2 seconds (+sdown) and comes back up (-sdown), it reads the last snapshot, and the slaves resync with the master.

The problem with this is that there may have been many writes between the last save and the +sdown. It seems like if the master goes from +sdown to -sdown and never +odown (where a failover is initiated), it should be able to sync FROM a slave. My reasoning is that the replication stream is continuous and the slaves most likely have a more accurate reflection of the masters state when +sdown happened.

Is there some config that I can do this? Am I forced to rely on the AOF or snapshots?

(Edit: adding sentinel tag)


回答1:


You cannot do a partial failover, either you do it or you don't in terms of promoting the slave to master.

From Redis Sentinel:

Automatic failover. If a master is not working as expected, Sentinel can start a failover process where a slave is promoted to master, the other additional slaves are reconfigured to use the new master, and the applications using the Redis server informed about the new address to use when connecting.



来源:https://stackoverflow.com/questions/22208798/redis-replication-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!