0

Imagine I have two data centers with one redis instance running in each of them. In addition, I have three sentinel instances running in these both data centers, each on a seperate machine, but two of them in the same data center.

Is this a problem?

In worst case, if the first the data center gets unavailable, two of the three sentinel instances + one redis instance shut down simultaneously. If this redis instance was the master, there would be failover to the other data center.

But what happens if data center 1 gets available again? I'd guess this would be the new configuration:

Data center 1 - Sentinel 1 -> Points to master in data center 1
Data center 1 - Sentinel 2 -> Points to master in data center 1
Data center 2 - Sentinel 1 -> Points to master in data center 2

Will redis set the master in data center 1 again as the new master? If so, what happens with database changes occured in the meantime at the master in data center 2?

Toni
  • 1,593
  • 1
  • 11
  • 21

1 Answers1

1

If the data center with two sentinels go down and also the master Redis node goes down, then the remaining sentinel node won't be able to elect a new master Redis or promote the Redis server in the other data center as master. Majority of the sentinels have to agree upon the failure of the master Redis. They also have to elect a sentinel process as the leader to promote the live Redis server as master; for that also majority of Sentinel processes have to be available. In case of 3 Sentinels deployment, the majority is 2 and when 2 of them are down, no failover for the master Redis will happen.

Nipun Talukdar
  • 4,975
  • 6
  • 30
  • 42