Does a MongoDB replica set require at least 2 or 3 members

mongodb

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?

Best Answer

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.