翻译或纠错本页面
- Reference >
- mongo Shell Methods >
- Replication Methods >
- rs.initiate()
rs.initiate()¶
Description¶
- rs.initiate(configuration)¶
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 “replSetInitiate” database command.
Replica Set Configuration¶
See 节点配置指南 and Replica Set Configuration for examples of replica set configuration and invitation objects.