Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Documentation here says three: http://docs.mongodb.org/manual/tutorial/deploy-replica-set/

"A replica set requires three distinct systems..."

Whereas the documentation here says two: http://docs.mongodb.org/manual/core/replication/

"Most replica sets consists of two or more mongod instances..."

Anyone know which is correct?

share|improve this question
add comment

2 Answers

You can actually run a single member "set" if you want.

3 members (or a higher odd number) is really best, though. Replica sets go read only if a majority of the set isn't available, so if you lose a member in a two-member set the remaining member becomes read only.

You can run two full members plus an "voting-only" member (called an arbiter) as well. This is the smallest reasonably safe option for a replica set.

share|improve this answer
add comment

This is basically a wording issue because the requirements in the tutorial are not a general statement about replica sets, rather they pertain to the tutorial itelf. The requirement for deploying a replica set in general is 1 or more, most have 2 or more, but the tutorial you link to is specifically to deploy a 3 member set:

This tutorial describes how to create a three member replica set from three existing instances of MongoDB

Hence, the requirement for the tutorial is that the set have 3 members. Nevertheless, it is a little confusing to have the two statements, so I submitted a pull request (EDIT: pull request has now been merged in) to clean it up a bit.

You can have a single mongod node configured to be part of a replica set, but strictly speaking that would not be a "set". In fact, since replication uses more resources than a standalone mongod (basically because of the oplog) there is really no point to running a single member unless it is as a temporary measure before you add other members to the set.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.