MongoDB Documentation, Release 3.0.4 Ensure that you can copy the data directory to the new member and begin replication within the window allowed by the oplog (page 593). Otherwise, the new instance will have to perform an initial sync, which completely resynchronizes the data, as described in Resync a Member of a Replica Set (page 633). Use rs.printReplicationInfo() to check the current state of replica set members with regards to the oplog. For background on replication deployment patterns, see the Replica Set Deployment Architectures (page 572) docu- ment. mongod --dbpath /srv/mongodb/db0 --replSet rs0 Take note of the host name and port information for the new mongod instance. For more information on configuration options, see the mongod manual page. You can specify the data directory and replica set in the mongod.conf configuration file , and start the mongod with the following command: mongod --config /etc/mongod.conf You can only add members while connected to the primary. If you do not know which member is the primary, log into any member of the replica set and issue the db.isMaster() command. rs.add("mongodb3.example.net") You can include the port number, depending on your setup: rs.add("mongodb3.example.net:27017") rs.conf() To view replica set status, issue the rs.status() method. For a description of the status fields, see http://docs.mongodb.org/manual/reference/command/replSetGetStatus . Configure and Add a Member You can add a member to a replica set by passing to the rs.add() method a members document. The document must be in the form of a replSetGetConfig.members document. These documents define a replica set member in the same form as the replica set configuration document (page 652). Important: Specify a value for the _id field of the members document. MongoDB does not automatically populate 617 9.3. Replica Set Tutorials 4. Verify that the member is now part of the replica set. Call the rs.conf() method, which displays the replica set configuration (page 652): 3. Use rs.add() to add the new member to the replica set. For example, to add a member at host mongodb3.example.net , issue the following command: 2. Connect to the replica set’s primary. 1. Start the new mongod instance. Specify the data directory and the replica set name. The following example specifies the /srv/mongodb/db0 data directory and the rs0 replica set: • Manually copy the data directory from an existing member. The new member becomes a secondary member and will catch up to the current state of the replica set. Copying the data over may shorten the amount of time for the new member to become current. Add a Member to an Existing Replica Set Optional