Search code examples
mongodbmongodb-replica-set

What if arbiter goes down?


I'm going to setup a mongodb replica set consisting of primary, slave and arbiter nodes. And I wonder what will happened if arbiter node goes down? Maybe somebody had such an experience.


Solution

  • If only the arbiter goes down, you still have two nodes (the primary and the secondary) that can communicate to each-other (and they form a majority: 2/3). So that will be fine. Being able to handle a one-node failure is exactly why you have that arbiter.

    Without the arbiter, if one node goes down, the other one cannot be sure if it should step up to become the primary because it does not know if the failed node cannot be reached because it is down or because of a network problem.

    With the arbiter, if any of the three nodes goes down, the two remaining ones can figure out what should happen.

    You could also have two secondaries instead of the extra arbiter. The important thing is to have a node count of at least three. But a secondary is much more expensive to run (it maintains a full copy of the database, whereas the arbiter has no data).

    Just make sure you bring the arbiter back up before the next problem happens.