We have had a good discussion on what a replica set is and how to start a simple replica set, in the Starting multiple instances as part of a replica set recipe in Chapter 1, Installing and Starting the MongoDB Server. In the Understanding interprocess security in MongoDB recipe, we saw how to start a replica set with interprocess authentication. To be honest, that is pretty much what we do while setting up a standard replica set. However, there are a few configurations that one must know; one must also be aware of how they affect the replica set's behavior. Note that we are still not discussing tag aware replication in this recipe; it will be taken up later in this chapter as a separate recipe Building tagged replica sets.
Refer to the recipe Starting multiple instances as part of a replica set in Chapter 1, Installing and Starting the MongoDB Server, for the prerequisites and to know about the replica set basics. Go ahead and set up a simple three...