Hi,
I've setup a cluster with 3 sentinel, 1 master and 1 replica. If I just stop the master, failover works fine. If I restart the old master it gets demoted to slave by sentinel, all fine so far.
But I have a problem if I simulate the following failure scenery: A is master B is the replica. I want to simulate a total downtime of both and a loss of A.
So I stopped services for A and B. After some time I only start B (lets play that A has some issue during some patchday or so -> it doesn't come up.
So I only have my replica B which cannot connect to master A (because it stays down).
sentinel failover mymaster does no not work.
It throws: (error) NOGOODSLAVE No suitable replica to promote
I tried to connect to the replica B and made id manually master by slaveof no one.
But the problem is:
If I now add new keys to B which is now master, it works, until I start the old master A. Then sentinel makes B slave again and replication starts. All data written to B after B was manually set to master is lost, because B gets the data of A.
How can I deal with this issue?
Thanks, Andreas
Comment From: polskikrol
I have the same question!
Comment From: sundb
you can use cluster failover force to forcely promote a replica to a master even if the master is down.