Two MongoDB replica nodes without arbiters

Is it possible to create a MongoDB replica set consisting of only 1 primary and 1 secondary elements? I would like to have a delayed replica set that will copy data from the primary with a delay of 24 hours. I know that I can put an arbiter on one of the servers (primary or secondary, I know this is not recommended, but my only desire is to run this configuration on two servers), and this will work fine, but I want to know if this is possible to completely knock out the referee. It will look like this: Two nodes replica set without arbiter

+7
database mongodb database-design
source share
4 answers

Short answer: no.

Long answer: The way to automatically switch failures in MongoDB is that for a set of replicas, a qualified majority is required to successfully select a new primary. Detained members have votes in the election. Therefore, if any of your nodes fails, the set of replicas discovers that it does not have this majority, and the current main steps down, even if it does not work. So what you basically do is double , the chance that your replica set will fail. Arbitrator is a very cheap process in terms of using RAM, processor and even disk space when starting with --smallfiles --no-journal --noprealloc or equivalent parameters specified in the configuration file. Please note that these options are safe to use, since the arbiter essentially only checks the heartbeats of nodes that carry data. For example, you can put an arbiter on an application server.

Disclaimer: The following procedure is highly recommended. Act at your own risk.

You can set the votes of the pending server to 0. Thus, the undelayed node will cause an election in case of an unsuccessful participant, concludes that it is the only node of the online replica and that it has the majority of votes (1/1) and will continue to work as expected. This course of action requires some attention, since you will again have an even number of votes if you add a member to the replica set later and require reconfiguration of the replica set. This also has serious implications for network fragmentation issues. Again: use at your own risk

+10
source share

Yes, you can, and all you really need to do is establish that the member does not have a primary right.

There is documentation on how to ensure that a member cannot be selected here as follows: http://docs.mongodb.org/manual/tutorial/configure-secondary-only-replica-set-member/

+3
source share

Yes, it is possible, but not recommended. Cautioning this approach is not an automatic failure.

If you are primary, then you will have to manually make the other server primary.

If you hold you back only as a mirror of your primary, and you are in good shape with manual resiliency, then it should work for you.

More details here:

http://openmymind.net/Does-My-Replica-Set-Need-An-Arbiter/

+2
source share

In this case, adding an arbitrator is the best option. I tried before with voices, but on 2 replicaset nodes you may have problems with synchronization.

+1
source share

All Articles