MongoDB复制参考

Replication Reference

复制参考

On this page

内容概览

Replication Methods in the mongo Shell

Name
Description

Adds a member to a replica set. 将成员添加到副本集。

Adds an arbiterarrow-up-right to a replica set. 将仲裁节点添加到副本集。

Returns the replica set configuration document. 返回副本集的配置内容。

Prevents the current member from seeking election as primary for a period of time. 阻止当前成员在一段时间内寻求选举为主节点。

Returns basic help text for replica setarrow-up-right functions. 返回副本集arrow-up-right功能的基本帮助文本。

Initializes a new replica set. 初始化新的副本集。

Prints a report of the status of the replica set from the perspective of the primary. 以主节点的角度来打印副本集状态的报告。

Prints a report of the status of the replica set from the perspective of the secondaries. 以从节点的角度来打印副本集状态的报告。

Re-configures a replica set by applying a new replica set configuration object. 通过应用新的副本集配置对象来重新配置副本集。

Remove a member from a replica set. 将成员从副本集中移除。

Returns a document with information about the state of the replica set. 返回包含关于副本集状态信息的文档。

Causes the current primaryarrow-up-right to become a secondary which forces an electionarrow-up-right. 使当前的主节点arrow-up-right转变为从节点,同时触发选举arrow-up-right

Sets the member that this replica set member will sync from, overriding the default sync target selection logic. 设置复制集成员从哪个成员中同步数据,同时覆盖默认的同步目标选择逻辑。

Replication Database Commands

Name
Description

Internal command that applies oplogarrow-up-right entries to the current data set. 内部命令,可将oplogarrow-up-right条目应用于当前数据集。

Displays information about this member’s role in the replica set, including whether it is the master. 显示关于此成员在副本集中的角色信息,包括它是否为主角色。

Forces the elected primaryarrow-up-right to abort sync (catch up) then complete the transition to primary. 对所选的主节点强行中止同步(即追平数据),然后完成到主节点的转换。

Prevents the current member from seeking election as primaryarrow-up-right for a period of time. 阻止当前成员在一段时间内寻求选举为主节点arrow-up-right

Returns the replica set’s configuration object. 返回副本集的配置对象。

Returns a document that reports on the status of the replica set. 返回报告副本集状态的文档。

Initializes a new replica set. 初始化新的副本集。

Enables or disables a maintenance mode, which puts a secondaryarrow-up-right node in a RECOVERING state. 启用或禁用维护模式,该模式会将从节点arrow-up-right置于RECOVERING状态。

Applies a new configuration to an existing replica set. 将新的配置应用于现有副本集。

Dynamically resizes the oplog for a replica set member. Available for WiredTiger storage engine only. 动态调整副本集成员oplog的大小。该功能仅适用于WiredTiger存储引擎。

Forces the current primaryarrow-up-right to step down and become a secondaryarrow-up-right, forcing an election. 使当前的主节点arrow-up-right转变为从节点arrow-up-right,,同时触发选举arrow-up-right

Explicitly override the default logic for selecting a member to replicate from. 显式重写用于选择要复制的成员的默认逻辑。

Replica Set Reference Documentation

副本集参考文档

最后更新于