Replication Reference复制引用

On this page本页内容

Replication Methods in the mongo Shellmongo Shell中的复制方法

Name名称Description描述
rs.add() Adds a member to a replica set.将成员添加到副本集中。
rs.addArb() Adds an arbiter to a replica set.仲裁器添加到副本集。
rs.conf() Returns the replica set configuration document.返回副本集配置文档。
rs.freeze() Prevents the current member from seeking election as primary for a period of time.阻止当前成员在一段时间内寻求作为初选成员的选举。
rs.help() Returns basic help text for replica set functions.返回副本集函数的基本帮助文本。
rs.initiate() Initializes a new replica set.初始化新的副本集。
rs.printReplicationInfo() Prints a report of the status of the replica set from the perspective of the primary.从主副本的角度打印副本集状态的报告。
rs.printSlaveReplicationInfo() Prints a report of the status of the replica set from the perspective of the secondaries.从二级副本的角度打印副本集状态的报告。
rs.reconfig() Re-configures a replica set by applying a new replica set configuration object.通过应用新的副本集配置对象来重新配置副本集。
rs.remove() Remove a member from a replica set.从副本集中删除成员。
rs.secondaryOk() Allows read operations on secondary members for the MongoDB connection.允许对MongoDB连接的辅助成员执行读取操作。
rs.status() Returns a document with information about the state of the replica set.返回包含副本集状态信息的文档。
rs.stepDown() Causes the current primary to become a secondary which forces an election.使当前的primary成为迫使选举进行的secondary选举
rs.syncFrom() Sets the member that this replica set member will sync from, overriding the default sync target selection logic.设置此复制集成员将从中同步的成员,覆盖默认的同步目标选择逻辑。

Replication Database Commands复制数据库命令

Name名称Description描述
applyOps Internal command that applies oplog entries to the current data set.oplog条目应用于当前数据集的内部命令。
isMaster Displays information about this member’s role in the replica set, including whether it is the master.显示有关此成员在副本集中的角色的信息,包括该成员是否为主成员。
replSetAbortPrimaryCatchUp Forces the elected primary to abort sync (catch up) then complete the transition to primary.强制选定的primary中止同步(追赶),然后完成到主设备的转换。
replSetFreeze Prevents the current member from seeking election as primary for a period of time.阻止当前成员在一段时间内寻求作为primary的选举。
replSetGetConfig Returns the replica set’s configuration object.返回副本集的配置对象。
replSetGetStatus Returns a document that reports on the status of the replica set.返回报告副本集状态的文档。
replSetInitiate Initializes a new replica set.初始化新的副本集。
replSetMaintenance Enables or disables a maintenance mode, which puts a secondary node in a RECOVERING state.启用或禁用维护模式,使secondary节点处于恢复状态。
replSetReconfig Applies a new configuration to an existing replica set.将新配置应用于现有副本集。
replSetResizeOplog Dynamically resizes the oplog for a replica set member. 动态调整副本集成员的oplog大小。Available for WiredTiger storage engine only.仅适用于WiredTiger存储引擎。
replSetStepDown Forces the current primary to step down and become a secondary, forcing an election.迫使目前的primary下台,成为secondary的选举。
replSetSyncFrom Explicitly override the default logic for selecting a member to replicate from.显式重写用于选择要从中复制的成员的默认逻辑。

Replica Set Reference Documentation副本集参考文档

Replica Set Configuration副本集配置
Complete documentation of the replica set configuration object returned by rs.conf().rs.conf()返回的副本集配置对象的完整文档。
Replica Set Protocol Version副本集协议版本
Reference on the replica set protocol version.副本集协议版本的参考。
Troubleshoot Replica Sets对副本集进行故障排除
Replica set trouble shooting guide.副本集故障排除指南。
The local Database本地数据库
Complete documentation of the content of the local database that mongod instances use to support replication.mongod实例用于支持复制的local数据库内容的完整文档。
Replica Set Member States副本集成员国
Reference for the replica set member states.副本集成员国的参考。