db.getReplicationInfo()

On this page本页内容

Definition定义

db.getReplicationInfo()

Returns a document with the status of the replica set, using data polled from the oplog. 使用从oplog轮询的数据返回具有副本集状态的文档。Use this output when diagnosing issues with replication.诊断复制问题时使用此输出。

Output输出

db.getReplicationInfo.logSizeMB

Returns the total size of the oplog in megabytes. 返回oplog的总大小(MB)。This refers to the total amount of space allocated to the oplog rather than the current size of operations stored in the oplog.这是指分配给oplog的总空间量,而不是oplog中存储的当前操作大小。

Starting in MongoDB 4.0, the oplog can grow past its configured size limit to avoid deleting the majority commit point.从MongoDB 4.0开始,oplog可以超过其配置的大小限制,以避免删除大多数提交点

db.getReplicationInfo.usedMB

Returns the total amount of space used by the oplog in megabytes. 返回oplog使用的总空间量(MB)。This refers to the total amount of space currently used by operations stored in the oplog rather than the total amount of space allocated.这是指oplog中存储的操作当前使用的空间总量,而不是分配的空间总量。

db.getReplicationInfo.errmsg

Returns an error message if there are no entries in the oplog.如果oplog中没有条目,则返回错误消息。

db.getReplicationInfo.oplogMainRowCount

Only present when there are no entries in the oplog. 仅当oplog中没有条目时出现。Reports a the number of items or rows in the oplog (e.g. 0).报告oplog中的项目或行数(例如0)。

db.getReplicationInfo.timeDiff

Returns the difference between the first and last operation in the oplog, represented in seconds.返回oplog中第一个和最后一个操作之间的差异,以秒表示。

Only present if there are entries in the oplog.仅当oplog中有条目时才显示。

db.getReplicationInfo.timeDiffHours

Returns the difference between the first and last operation in the oplog, rounded and represented in hours.返回oplog中第一次和最后一次操作之间的差值,四舍五入并以小时表示。

Only present if there are entries in the oplog.仅当oplog中有条目时才显示。

db.getReplicationInfo.tFirst

Returns a time stamp for the first (i.e. earliest) operation in the oplog. 返回oplog中第一次(即最早)操作的时间戳。Compare this value to the last write operation issued against the server.将此值与针对服务器发出的上次写入操作进行比较。

Only present if there are entries in the oplog.仅当oplog中有条目时才显示。

db.getReplicationInfo.tLast

Returns a time stamp for the last (i.e. latest) operation in the oplog. 返回oplog中最后一次(即最近一次)操作的时间戳。Compare this value to the last write operation issued against the server.将此值与针对服务器发出的上次写入操作进行比较。

Only present if there are entries in the oplog.仅当oplog中有条目时才显示。

db.getReplicationInfo.now

Returns a timestamp that reflects the current time. 返回反映当前时间的时间戳。The shell process generates this value, and the datum may differ slightly from the server time if you're connecting from a remote host as a result. shell进程会生成此值,如果结果是从远程主机连接,则数据可能与服务器时间略有不同。Equivalent to Date().等效于Date()

Only present if there are entries in the oplog.仅当oplog中有条目时才显示。

←  db.getProfilingStatus()db.getSiblingDB() →