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

Solution 1:

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.

Solution 2:

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 or if you require an oplog for other reasons (such as backup).