Redis replication config

2019-02-20 01:51发布

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条回答
兄弟一词,经得起流年.
2楼-- · 2019-02-20 02:26

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.

查看更多
登录 后发表回答