0

I think I already have the answer, but I'm a developer so thought I'd check here first.

There are AWS regions with more than 2 zone, but some with only 2. E.g. Sydney.

Now if I were to deploy a mongodb replica set cluster across only 2 availability zone, I am getting the impression that it is NOT possible for the cluster to fail over automatically.

Reason being if one of the two zones went offline and take out the majority of your nodes, the rest of the nodes in the other zone won't elect a new primary? It'll be up to someone manually going into one of the nodes and promoting it as a primary.

Or am I missing something.

3
  • You could try to work with arbiters in a different region (you can install multiple arbiter on one machine). So you could get a majority during primary voting even if the AZ with the majority of Mongod goes down.
    – Osterjour
    May 10, 2014 at 18:23
  • @Osterjour afaik, arbiter just counts towards your majority? May 11, 2014 at 9:27
  • I don't know this for sure, but in my understanding an arbiter is just a replica member without data (so it can't become primary). If this definition is true you have to chance to setup the following: ap-southeast-2a: 2 MongoD, ap-southeast-2b: 1 MongoD, ap-southeast-1a: 2 Arbiter. Without the arbiters your replica will get offline if ap-southeast-2a is offline. But with the arbiters (hopefully!) ap-southeast-2b still gets the majority and will become primary.
    – Osterjour
    May 11, 2014 at 14:39

1 Answer 1

1

That's essentially correct - to state it more explicitly: you will be able to have automatic failover for one zone but not the other. In other words, whichever zone has more nodes can successfully take over automatically if the zone with less nodes fails. If the zone with the greater number of nodes fails then the remaining nodes in the other zone will not be able to form a majority and elect a primary without manual intervention.

Note that this is the case regardless of how many nodes you deploy with 2 zones, data centers or whatever the unit of failure is, it's just a basic issue in terms of forming a strict majority in that scenario.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .