MongoDB Documentation, Release 3.0.4 Add Members to the Replica Set Step 3: Convert the standalone mongod to a single-node replica set Convert the standalone mongod process to a single-node replica set by shutting down the mongod instance, and restarting it with the --replSet option, as in the following example: mongod --dbpath /data/db --replSet <replName> Optionally, you can explicitly set a oplogSizeMB to control the size of the oplog created for this replica set member. Step 4: Connect to the mongod instance. For example, first use the following command to a mongod instance running on the localhost interface: mongo Step 5: Initiate the new replica set. Use rs.initiate() to initiate the new replica set, as in the following example: rs.initiate() MongoDB provides two options for restoring secondary members of a replica set: The following sections outlines both approaches. Note: If your database is large, initial sync can take a long time to complete. For large databases, it might be preferable to copy the database files onto each host. Copy Database Files and Restart mongod Instance Use the following sequence of operations to “seed” additional members of the replica set with the restored data by copying MongoDB data files directly. Step 1: Shut down the mongod instance that you restored. Use --shutdown or db.shutdownServer() to ensure a clean shut down. Step 2: Copy the primary’s data directory to each secondary. Copy the primary’s data directory into the dbPath of the other members of the replica set. The dbPath is /data/db by default. Step 4: Add the secondaries to the replica set. In a mongo shell connected to the primary , add the secondaries to the replica set using rs.add() . See Deploy a Replica Set (page 603) for more information about deploying a replica set. Step 3: Start the mongod instance that you restored. • Manually copy the database files to each data directory. • Allow initial sync (page 594) to distribute data automatically. Update Secondaries using Initial Sync Use the following sequence of operations to “seed” additional members of the replica set with the restored data using the default initial sync operation. Chapter 5. Administration 248