This version of the documentation is archived and no longer supported.




Initiates a replica set. Optionally takes a configuration argument in the form of a document that holds the configuration of a replica set.

The rs.initiate() method has the following parameter:

Parameter Type Description
configuration document Optional. A document that specifies configuration settings for the new replica set. If a configuration is not specified, MongoDB uses a default configuration.

The rs.initiate() method provides a wrapper around the “replSetInitiatedatabase command.

Replica Set Configuration

See Member Configuration Tutorials and Replica Set Configuration for examples of replica set configuration and invitation objects.

← rs.reconfig()  →