Docs HomeMongoDB Manual

Replica Set Configuration副本集配置

You can access the configuration of a replica set using the rs.conf() method or the replSetGetConfig command.您可以使用rs.conf()方法或replSetGetConfig命令访问副本集的配置。

To modify the configuration for a replica set, use the rs.reconfig() method, passing a configuration document to the method. 要修改副本集的配置,请使用rs.reconfig()方法,将配置文档传递给该方法。See rs.reconfig() for more information.有关详细信息,请参阅rs.reconfig()

Warning

Avoid reconfiguring replica sets that contain members of different MongoDB versions as validation rules may differ across MongoDB versions.避免重新配置包含不同MongoDB版本成员的副本集,因为验证规则可能因MongoDB版本而异。

Replica Set Configuration Document Example副本集配置文档示例

The following document provides a representation of a replica set configuration document. 以下文档提供了副本集配置文档的表示形式。The configuration of your replica set may include only a subset of these settings:复制副本集的配置可能只包括以下设置的一个子集:

{
_id: <string>,
version: <int>,
term: <int>,
protocolVersion: <number>,
writeConcernMajorityJournalDefault: <boolean>,
configsvr: <boolean>,
members: [
{
_id: <int>,
host: <string>,
arbiterOnly: <boolean>,
buildIndexes: <boolean>,
hidden: <boolean>,
priority: <number>,
tags: <document>,
secondaryDelaySecs: <int>,
votes: <number>
},
...
],
settings: {
chainingAllowed : <boolean>,
heartbeatIntervalMillis : <int>,
heartbeatTimeoutSecs: <int>,
electionTimeoutMillis : <int>,
catchUpTimeoutMillis : <int>,
getLastErrorModes : <document>,
getLastErrorDefaults : <document>,
replicaSetId: <ObjectId>
}
}

Replica Set Configuration Fields副本集配置字段

_id

Type: string

The name of the replica set.复制副本集的名称。

_id must be identical to the replication.replSetName or the value of --replSet specified to mongod on the command line.必须与命令行上为mongod指定的replication.replSetName--replSet的值相同。

Tip

See: 请参阅:

replSetName or --replSet for information on setting the replica set name.replSetName--replSet获取有关设置副本集名称的信息。

version

Type: int

An incrementing number used to distinguish revisions of the replica set configuration document from previous iterations of the configuration.一个递增的数字,用于将副本集配置文档的修订与以前的配置迭代区分开来。

Changed in version 4.4在版本4.4中更改: Replica set members use term and version to achieve consensus on the "newest" replica configuration. :副本集成员使用termversion来就“最新”的副本配置达成共识。When members compare replica configuration documents, the configuration document with a larger term is considered the "newest". 当成员比较副本配置文档时,术语较大的配置文档被视为term配置文档。If term is the same or absent, the configuration document with the larger version is considered "newest".如果term相同或不存在,则较大version的配置文件被视为“最新”。

term

Type: int

New in version 4.4.4.4版新增。

Only available with featureCompatibilityVersion (fCV) "4.4" or later.仅适用于featureCompatibilityVersion (fCV) "4.4"或更高版本。

An incrementing number used to distinguish revisions of the replica set configuration document from previous iterations of the configuration. 一个递增的数字,用于将副本集配置文档的修订与以前的配置迭代区分开来。The term of a configuration document matches the term of the replica set primary which performed the reconfiguration. 配置文档的term与执行重新配置的primary副本集的术语相匹配。The primary increments its term each time it steps up after winning an election. primary在赢得选举后每增加一次任期。The primary ignores the term field if set explicitly in the replSetReconfig operation.如果在replSetReconfig操作中显式设置,则primary将忽略term字段。

Issuing a force reconfiguration removes the term field. 发布force重新配置将删除term字段。When the primary next issues replSetReconfig without force, it sets the term to its own term.当primary下一步在没有强制的情况下发出replSetReconfig时,它会将术语设置为自己的术语。

Replica set members use term and version to achieve consensus on the "newest" replica configuration. 副本集成员使用termversion来就“最新”的副本配置达成共识。When members compare replica configuration documents, the configuration document with a larger term is considered the "newest". 当成员比较副本配置文档时,term较大的配置文档被视为“最新”配置文档。If term is the same or absent, the configuration document with the larger version is considered "newest".如果term相同或不存在,则较大version的配置文件被视为“最新”。

configsvr

Type: boolean

Default: false

Indicates whether the replica set is used for a sharded cluster's config servers. 指示副本集是否用于分片集群的配置服务器。Set to true if the replica set is for a sharded cluster's config servers.如果副本集用于分片集群的配置服务器,则设置为true

protocolVersion

Type: number

Default: 1

Starting in 4.0, MongoDB only supports protocolVersion: 1 and no longer supports protocolVersion: 0.从4.0开始,MongoDB只支持protocolVersion: 1,不再支持protocolVersion: 0

writeConcernMajorityJournalDefault

Type: boolean

Default: true

Determines the behavior of { w: "majority" } write concern if the write concern does not explicitly specify the journal option j.如果写入关注没有明确指定日志选项j,则确定{ w: "majority" }写入关注的行为。

The following table lists the writeConcernMajorityJournalDefault values and the associated { w: "majority" } behavior:下表列出了writeConcernMajorityJournalDefault值和相关的{ w: "majority" }行为:

Value{ w: "majority" } Behavior行为
trueMongoDB acknowledges the write operation after a majority of the voting members have written to the on-disk journal.MongoDB在大多数投票成员向磁盘日志写入内容后确认写入操作。
Important
All voting members of the replica set must run with journaling when writeConcernMajorityJournalDefault is true.writeConcernMajorityJournalDefaulttrue时,副本集的所有投票成员都必须运行日志。
If any voting member of a replica set uses the in-memory storage engine, you must set writeConcernMajorityJournalDefault to false.如果副本集的任何投票成员使用内存存储引擎,则必须将writeConcernMajorityJournalDefault设置为false
If any voting member of a replica set uses the in-memory storage engine and writeConcernMajorityJournalDefault is true, "majority" write operations may fail. 如果副本集的任何投票成员使用内存存储引擎,并且writeConcernMajorityJournalDefaulttrue,则"majority"写入操作可能会失败。These include operations that inherently use "majority" write concern, such as the replSetStepDown command, or various mongosh methods that by default use "majority" write concern, such as user management methods and role management methods.其中包括固有地使用"majority"写入关注的操作,replSetStepDown命令,或默认使用"majority"写入关注的各种mongosh方法,如用户管理方法角色管理方法
Starting in version 4.2 (and 4.0.13 and 3.6.14 ), if a replica set member uses the in-memory storage engine (voting or non-voting) but the replica set has writeConcernMajorityJournalDefault set to true, the replica set member logs a startup warning.从版本4.2(以及4.0.13和3.6.14)开始,如果副本集成员使用内存存储引擎(投票或非投票),但副本集的writeConcernMajorityJournalDefault设置为true,则副本集成员会记录启动警告。
falseMongoDB acknowledges the write operation after a majority of the voting members have applied the operation in memory.在大多数投票成员在内存中应用了写操作后,MongoDB确认写操作。
Warning
If any voting member of a replica set uses the in-memory storage engine, you must set writeConcernMajorityJournalDefault to false.如果副本集的任何投票成员使用内存存储引擎,则必须将writeConcernMajorityJournalDefault设置为false
Starting in version 4.2 (and 4.0.13 and 3.6.14 ), if a replica set member uses the in-memory storage engine (voting or non-voting) but the replica set has writeConcernMajorityJournalDefault set to true, the replica set member logs a startup warning.从版本4.2(以及4.0.13和3.6.14)开始,如果副本集成员使用内存存储引擎(投票或非投票),但副本集的writeConcernMajorityJournalDefault设置为true,则副本集成员会记录启动警告。
You cannot run transactions on a sharded cluster that has a shard with writeConcernMajorityJournalDefault set to false (such as a shard with a voting member that uses the in-memory storage engine).您不能在具有writeConcernMajorityJournalDefault设置为false的分片(例如具有使用内存存储引擎的投票成员的分片)的分片集群上运行事务。

members

members

Type: array

An array of member configuration documents, one for each member of the replica set. 一组成员配置文档,副本集中的每个成员一个。The members array is a zero-indexed array.members数组是一个零索引数组。

Each member-specific configuration document can contain the following fields:每个特定于成员的配置文档都可以包含以下字段:

members[n]._id

Type: integer

An integer identifier for the member in the replica set, unique among all members.副本集中成员的整数标识符,在所有成员中是唯一的。

Starting in MongoDB 5.0, values may be any integer value greater than or equal to 0. 从MongoDB 5.0开始,值可以是任何大于或等于0的整数值。Previously, this value was limited to an integer between 0 and 255 inclusive.以前,此值被限制为介于0255之间(包括0和255)的整数。

Each replica set member must have a unique _id. 每个副本集成员都必须有一个唯一的_idAvoid re-using _id values even if no members[n] entry is using that _id in the current configuration.避免重复使用_id值,即使当前配置中没有members[n]条目使用该_id

Once set, you cannot change the _id of a member.一旦设置,就不能更改成员的_id

Note

When updating the replica configuration object, access the replica set members in the members array with the array index. 更新副本配置对象时,请使用数组索引访问members数组中的副本集成员。The array index begins with 0. Do not confuse this index value with the value of the members[n]._id field in each document in the members array.数组索引以0开头。不要将此索引值与members数组中每个文档中的members[n]._id字段的值混淆。

members[n].host

Type: string

The hostname and, if specified, the port number, of the set member.集合成员的主机名和端口号(如果指定)。

The hostname name must be resolvable for every host in the replica set.主机名必须可解析为复制集中的每个主机。

Warning

members[n].host cannot hold a value that resolves to localhost or the local interface unless all members of the set are on hosts that resolve to localhost.不能保存解析为localhost或本地接口的值,除非该集合的所有成员都位于解析为localhost的主机上。

members[n].arbiterOnly

Optional.

Type: boolean

Default: false

A boolean that identifies an arbiter. 用于标识仲裁器的布尔值。A value of true indicates that the member is an arbiter.值为true表示该成员是仲裁人。

When using the rs.addArb() method to add an arbiter, the method automatically sets members[n].arbiterOnly to true for the added member.当使用rs.addArb()方法添加仲裁器时,该方法会为添加的成员自动将members[n].arbiterOnly设置为true

For the following MongoDB versions, pv1 increases the likelihood of w:1 rollbacks compared to pv0 (no longer supported in MongoDB 4.0+) for replica sets with arbiters:对于以下MongoDB版本,与带有仲裁器的副本集的pv0(在MongoDB 4.0+中不再支持)相比,pv1增加了w:1回滚的可能性:

  • MongoDB 3.4.1
  • MongoDB 3.4.0
  • MongoDB 3.2.11 or earlier

See Replica Set Protocol Version.副本集协议版本。

members[n].buildIndexes

Optional.

Type: boolean

Default: true

A boolean that indicates whether the mongod builds indexes on this member. 一个布尔值,指示mongod是否在此成员上构建索引You can only set this value when adding a member to a replica set. 只有在将成员添加到副本集中时,才能设置此值。You cannot change members[n].buildIndexes field after the member has been added to the set. 将成员添加到集合后,不能更改members[n].buildIndexes字段。To add a member, see rs.add() and rs.reconfig().要添加成员,请参阅rs.add()rs.reconfig()

Do not set to false for mongod instances that receive queries from clients.对于从客户端接收查询的mongod实例,不要设置为false

Setting buildIndexes to false may be useful if all the following conditions are true:如果以下所有条件都为true,则将buildIndexes设置为false可能很有用:

  • you are only using this instance to perform backups using mongodump, and您仅使用此实例使用mongodump执行备份,并且
  • this member will receive no queries, and该成员将不会收到任何查询,并且
  • index creation and maintenance overburdens the host system.索引的创建和维护使主机系统负担过重。

Even if set to false, secondaries will build indexes on the _id field in order to facilitate operations required for replication.即使设置为false,辅助设备也会在_id字段上构建索引,以便于进行复制所需的操作。

Warning

If you set members[n].buildIndexes to false, you must also set members[n].priority to 0. 如果将members[n].buildIndexes设置为false,则还必须将members[n].priority设置为0If members[n].priority is not 0, MongoDB will return an error when attempting to add a member with members[n].buildIndexes equal to false.如果members[n].priority不为0,MongoDB在尝试添加members[n].buildIndexes等于false的成员时将返回错误。

To ensure the member receives no queries, you should make all instances that do not build indexes hidden.为了确保成员不会收到任何查询,应该隐藏所有未生成索引的实例。

Other secondaries cannot replicate from a member where members[n].buildIndexes is false.如果members[n].buildIndexesfalse,则其他辅助设备无法从该成员进行复制。

members[n].hidden

Optional.

Type: boolean

Default: false

When this value is true, the replica set hides this instance and does not include the member in the output of db.hello() or hello. 当该值为true时,副本集将隐藏此实例,并且在db.hello()hello的输出中不包括该成员。This prevents read operations (i.e. queries) from ever reaching this host by way of secondary read preference.这将阻止读取操作(即查询)通过secondary读取首选项到达此主机。

Hidden members can acknowledge write operations issued with Write Concern. 隐藏成员可以确认使用写入关注发出的写入操作。For write operations issued with "majority" write concern, the member must also be a voting member (i.e. votes is greater than 0).对于以"majority"写入关注发布的写入操作,该成员还必须是有投票权的成员(即,votes大于0)。

members[n].priority

Optional.

Type: Number between 0 and 1000 for primary/secondary; 0 or 1 for arbiters.:primary/secondary的数字介于0和1000之间;0或1表示仲裁器。

Default: 1.0 for primary/secondary; 0 for arbiters.:primary/secondary为1;仲裁器为0

A number that indicates the relative likelihood of a replica set member to become the primary.一个数字,表示复制集成员成为primary的相对可能性。

  • To increase the likelihood that a member becomes the primary, specify a higher priority value for that member.要增加成员成为primary的可能性,请为该成员指定更高的priority值。
  • To decrease the likelihood that a member becomes the primary, specify a lower priority value for that member.若要降低某个成员成为primary的可能性,请为该成员指定一个priority较低的值。

Changing a member's priority triggers one or more elections. 更改成员的优先级会触发一次或多次选举。The election algorithm makes a best-effort attempt to elect the highest-priority member the primary. 选举算法尽最大努力来选举最高优先级的成员作为primary。However, a lower-priority member may become the primary even if a higher-priority secondary is available.然而,即使有较高优先级的secondary成员可用,较低优先级的成员也可能成为primary成员。

If a lower-priority member becomes the primary, the server continues to periodically call elections until the highest-priority replica set member is the primary. 如果优先级较低的成员成为主成员,服务器将继续定期调用选举,直到优先级最高的副本集成员成为主。The frequency at which the elections occur depends on the difference in priority between the elected member and the highest-priority member.选举的频率取决于当选成员和最高优先级成员之间的优先级差异。

A member with a priority of 0 cannot become the primary.优先级为0的成员不能成为primary。

Non-voting members (meaning members that have votes set to 0) must have a priority of 0.无表决权成员(指votes设置为0的成员)的优先级必须为0

members[n].tags

Optional.

Type: document

Default: none

A tags document contains user-defined tag field and value pairs for the replica set member.tags文档包含复制集成员的用户定义的标记字段和值对。

{ "<tag1>": "<string1>", "<tag2>": "<string2>",... }

For more information, see Configure Replica Set Tag Sets.请参阅配置副本集标记集以了解更多信息。

members[n].secondaryDelaySecs

Optional.

Type: integer

Default: 0

The number of seconds "behind" the primary that this replica set member should "lag".此复制集成员应“滞后”于主复制集的秒数。

Use this option to create delayed members. 使用此选项可以创建延迟成员Delayed members maintain a copy of the data that reflects the state of the data at some time in the past.延迟成员维护一份数据副本,该副本反映了过去某个时间的数据状态。

Delayed members can contribute to acknowledging write operations issued with Write Concern. 延迟的成员可能有助于确认写入关注发出的写入操作。However, they return write acknowledgment no earlier than the configured delay value. 但是,它们返回的写入确认不早于配置的延迟值。For write operations issued with "majority" write concern, the member must also be a voting member (i.e. votes is greater than 0).对于以"majority"写入关注发布的写入操作,该成员还必须是有投票权的成员(即,votes大于0)。

members[n].votes

Optional.

Type: integer

Default: 1

The number of votes a server will cast in a replica set election. 服务器将在副本集选举中投出的票数。The number of votes each member has is either 1 or 0, and arbiters always have exactly 1 vote.每个成员的票数要么是1,要么是0仲裁器总是有1票。

Members with priority greater than 0 cannot have 0 votes.priority大于0的成员不能有0票。

A replica set can have up to 50 members but only 7 voting members. 副本集最多可以有50个成员,但只有7个有投票权的成员。If you need more than 7 members in one replica set, set members[n].votes to 0 for the additional non-voting members.如果一个副本集中需要7个以上的成员,请将其他无投票权成员的members[n].votes设置为0

Non-voting (i.e. votes is 0) members must have priority of 0.无表决权(即votes0)成员的priority必须为0

Starting in MongoDB 5.0, a newly added secondary does not count as a voting member and cannot be elected until it has reached SECONDARY state.从MongoDB 5.0开始,新添加的secondary不算作投票成员,在达到SECONDARY状态之前无法当选。

Non-voting members cannot acknowledge write operations issued with a "majority" write concern.无表决权的成员不能承认以"majority"写入关注发出的写入操作。

settings

settings

Optional.

Type: document

A document that contains configuration options that apply to the whole replica set.包含应用于整个复制副本集的配置选项的文档。

The settings document contain the following fields:settings文档包含以下字段:

settings.chainingAllowed

Optional.

Type: boolean

Default: true

In MongoDB 5.0.1, 4.2.15, 4.4.7, and earlier, if settings.chainingAllowed is:在MongoDB 5.0.1、4.2.15、4.4.7及更早版本中,如果settings.chainingAllowed为:

  • true, replica set secondary members can replicate data from other secondary members.true,副本集secondary成员可以从其他secondary成员复制数据。
  • false, secondary members can replicate data only from the primary.false,secondary成员只能从primary复制数据。

Starting in MongoDB 5.0.2, 4.2.16, and 4.4.8:从MongoDB 5.0.2、4.2.16和4.4.8开始:

Tip
settings.getLastErrorDefaults

Optional.

Type: document

Unavailable starting in MongoDB 5.0.在MongoDB 5.0中启动时不可用。

Important

Starting in MongoDB 5.0, you cannot specify a default write concern with settings.getLastErrorDefaults other than the default of { w: 1, wtimeout: 0 } . 从MongoDB 5.0开始,除了{ w: 1, wtimeout: 0 }的默认值之外,您不能使用settings.getLastErrorDefaults指定默认写入关注。Instead, use the setDefaultRWConcern command to set the default read or write concern configuration for a replica set or sharded cluster.相反,使用setDefaultRWConcern命令为副本集或分片集群设置默认的读或写入关注配置。

settings.getLastErrorModes

Optional.

Type: document

A document used to define a custom write concern through the use of members[n].tags. 用于通过使用members[n].tags来定义自定义写入关注的文档。The custom write concern can provide data-center awareness.自定义写入关注可以提供数据中心意识

{ getLastErrorModes: {
<name of write concern> : { <tag1>: <number>, .... },
...
} }

The <number> refers to the number of different tag values required to satisfy the write concern. <number>是指满足写入关注所需的不同标记值的数量。For example, the following settings.getLastErrorModes defines a write concern named datacenter that requires the write to propagate to two members whose dc tag values differ.例如,以下settings.getLastErrorModes定义了一个名为datacenter的写入关注,该问题要求写入传播到dc标记值不同的两个成员。

{ getLastErrorModes: { datacenter: { "dc": 2 } } }

To use the custom write concern, pass in the write concern name to the w Option, e.g.要使用自定义写入关系,请将写入关系名称传递给w选项,例如。

{ w: "datacenter" }

See Configure Replica Set Tag Sets for more information and example.有关详细信息和示例,请参阅配置副本集标记集

settings.heartbeatTimeoutSecs

Optional.

Type: int

Default: 10

Number of seconds that the replica set members wait for a successful heartbeat from each other. 复制副本集成员等待彼此成功发送检测信号的秒数。If a member does not respond in time, other members mark the delinquent member as inaccessible.如果某个成员没有及时响应,其他成员会将该违规成员标记为无法访问。

settings.electionTimeoutMillis

Optional.

Type: int

Default: 10000 (10 seconds)

The time limit in milliseconds for detecting when a replica set's primary is unreachable. 检测副本集的主副本何时不可访问的时间限制(以毫秒为单位)。This setting controls failover sensitivity when using protocolVersion: 1. 此设置控制使用protocolVersion: 1时的故障转移敏感性。You can expect the failover timeout to not exceed the value of electionTimeoutMillis.您可以期望故障转移超时不超过electionTimeoutMillis的值。

Consider the following when selecting a value:选择值时请考虑以下事项:

  • Higher values result in slower failovers but decreased sensitivity to primary node or network slowness or spottiness.较高的值会导致故障切换较慢,但会降低对主节点或网络缓慢或不稳定的敏感性。
  • Lower values result in faster failover but increased sensitivity to primary node or network slowness or spottiness.值越低,故障切换越快,但对主节点或网络速度慢或不稳定的敏感度越高。

The setting only applies when using protocolVersion: 1.该设置仅适用于使用protocolVersion: 1的情况。

Note

When you step down a primary using rs.stepDown() or replSetStepDown without setting the force field to true, the stepped-down primary nominates an eligible secondary to call an election immediately.当您使用rs.stepDown()replSetStepDown在未将force字段设置为true的情况下退出primary时,退出的primary会提名一个合格的secondary立即进行选举。

settings.catchUpTimeoutMillis

Optional.

Type: int

Changed in version 3.6.3.6版更改。

Default: -1, infinite catchup time.:-1,无限追赶时间。

Time limit in milliseconds for a newly elected primary to sync (catch up) with the other replica set members that may have more recent writes. 新选择的主复制集与其他可能有最近写入的复制集成员同步(赶上)的时间限制(以毫秒为单位)。Infinite or high time limits may reduce the amount of data that the other members would need to roll back after an election but may increase the failover time.无限或高时间限制可能会减少其他成员在选举后需要回滚的数据量,但可能会增加故障转移时间。

The newly elected primary ends the catchup period early once it is fully caught up with other members of the set. During the catchup period, the newly elected primary is unavailable for writes from clients. 新当选的初选一旦完全赶上了其他成员,就提前结束了追赶期。在追赶期间,新选择的主服务器不可用于客户端的写入。Use replSetAbortPrimaryCatchUp to abort the catchup then complete the transition to primary.使用replSetAbortPrimaryCatchUp中止追赶,然后完成到主要的转换。

The setting only applies when using protocolVersion: 1.该设置仅适用于使用protocolVersion: 1的情况。

Note

To downgrade a replica set initiated in version 3.6 to 3.4, change catchUpTimeoutMillis from -1 to a positive number. 要将3.6版中启动的复制副本集降级到3.4,请将catchUpTimeoutMillis-1更改为正数。Failure to change this value to a positive number causes nodes running version 3.4 to neither restart nor join the replica set.未能将此值更改为正数会导致运行版本3.4的节点既不能重新启动也不能加入副本集。

settings.catchUpTakeoverDelayMillis

Optional.

Type: int

Default: 30000 (30 seconds)

Time in milliseconds a node waits to initiate a catchup takeover after determining it is ahead of the current primary. 节点在确定其领先于当前primary之后等待启动追赶接管的时间(以毫秒为单位)。During a catchup takeover, the node ahead of the current primary initiates an election to become the new primary of the replica set.在追赶接管过程中,当前主节点之前的节点会启动一个选举,以成为副本集的新主节点。

After the node initiating the takeover determines that it is ahead of the current primary, it waits the specified number of milliseconds and then verifies the following:在启动接管的节点确定它领先于当前primary之后,它将等待指定的毫秒数,然后验证以下内容:

  1. It is still ahead of the current primary,它仍然领先于当前的初级,
  2. It is the most up-to-date node among all available nodes,它是所有可用节点中最新的节点,
  3. The current primary is currently catching up to it.当前的初选正在赶上它。

Once determining that all of these conditions are met, the node initiating the takeover immediately runs for election.一旦确定满足所有这些条件,发起接管的节点就会立即运行以进行选举。

For more information on Replica Set Elections, see Replica Set Elections.有关副本集选举的详细信息,请参阅副本集选举

Note

Setting catchUpTakeoverDelayMillis to -1 disables catchup takeover. catchUpTakeoverDelayMillis设置为-1将禁用追赶接管。Setting catchUpTimeoutMillis to 0 disables primary catchup and consequently also catchup takeover.catchUpTimeoutMillis设置为0将禁用主追赶,从而也会禁用追赶接管。

settings.heartbeatIntervalMillis

Internal use only.

The frequency in milliseconds of the heartbeats.心跳的频率(以毫秒为单位)。

settings.replicaSetId

Type: ObjectId

The ObjectId associated with the replica set and automatically created during rs.initiate() or replSetInitiate. 与副本集关联并在rs.initiate()replSetInitiate期间自动创建的ObjectId。You cannot change the replicaSetId.您无法更改replicaSetId