MongoDB Documentation, Release 3.0.4 Procedure 615 9.3. Replica Set Tutorials For more information on configuration options, see and the mongod manual page. 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. mongod --port 27017 --dbpath /srv/mongodb/db0 --replSet rs0 For example, the following command starts a standalone instance as a member of a new replica set named rs0 . The command uses the standalone’s existing database path of /srv/mongodb/db0 : The replica set is now operational. rs.initiate() To view the replica set configuration, use rs.conf() . To check the status of the replica set, use rs.status() . Expand the Replica Set Add additional replica set members by doing the following: rs.add("<hostname><:port>") Replace <hostname> and <port> with the resolvable hostname and port of the mongod instance to add to the set. For more information on adding a host to a replica set, see Add Members to a Replica Set (page 616). db.getSiblingDB("config").shards.save( {_id: "<name>", host: Replace <name> with the name of the shard. Replace <replica-set> with the name of the replica set. Replace <member,><member,><> with the list of the members of the replica set. Sharding Considerations If the new replica set is part of a sharded cluster , change the shard host information in the config database by doing the following: 1. Connect to one of the sharded cluster’s mongos instances and issue a command in the following form: 2. Restart all mongos instances. If possible, restart all components of the replica sets (i.e., all mongos and all shard mongod instances). 2. On your connection to the original mongod instance (the former standalone instance), issue a command in the following form for each new instance to add to the replica set: 1. On two distinct systems, start two new standalone mongod instances. For information on starting a standalone instance, see the installation tutorial (page 5) specific to your environment. 4. Use rs.initiate() to initiate the new replica set: 3. Connect to the mongod instance. 2. Restart the instance. Use the --replSet option to specify the name of the new replica set. 1. Shut down the standalone mongod instance.