MongoDB Documentation, Release 3.0.4 Step 1: Start each member of the replica set with the appropriate options. For each member, start a mongod and specify the replica set name through the replSet option. Specify any other parameters specific to your deployment. For replication-specific parameters, see cli-mongod-replica-set . If your application connects to more than one replica set, each set should have a distinct name. Some drivers group replica set connections by replica set name. The following example specifies the replica set name through the --replSet command-line option: mongod --replSet "rs0" You can also specify the replica set name in the configuration file . To start mongod with a configu- ration file, specify the file with the --config option: mongod --config $HOME/.mongodb/config In production deployments, you can configure a control script to manage this process. Control scripts are beyond the scope of this document. Step 2: Connect a mongo shell to a replica set member. For example, to connect to a mongod running on localhost on the default port of 27017 , simply issue: mongo Step 3: Initiate the replica set. Use rs.initiate() on the replica set member: rs.initiate() MongoDB initiates a set that consists of the current member and that uses the default replica set configuration. Step 4: Verify the initial replica set configuration. Use rs.conf() to display the replica set configuration object (page 652): rs.conf() The replica set configuration object resembles the following: Step 8: Check the status of the replica set. Use the rs.status() operation: rs.status() Step 5: Add the remaining members to the replica set. Use rs.add() in a mongo shell connected to the current primary. The commands should resemble the following: 612 Chapter 9. Replication { "_id" : "rs0", "version" : 1, "members" : [ { "_id" : 1, "host" : "mongodb0.example.net:27017" } ] }