发布于 2015-09-14 14:49:38 | 112 次阅读 | 评论: 0 | 来源: 网络整理

The db.getReplicationInfo() provides current status of the current replica status, using data polled from the “oplog”. Consider the values of this output when diagnosing issues with replication.

也可以参考

副本集基本概念” for more information on replication.

All Nodes

The following fields are present in the output of db.getReplicationInfo() for both primary and secondary nodes.

db.getReplicationInfo.logSizeMB

Returns the total size of the oplog in megabytes. This refers to the total amount of space allocated to the oplog rather than the current size of operations stored in the oplog.

db.getReplicationInfo.usedMB

Returns the total amount of space used by the oplog in megabytes. This refers to the total amount of space currently used by operations stored in the oplog rather than the total amount of space allocated.

Primary Nodes

The following fields appear in the output of db.getReplicationInfo() for primary nodes.

db.getReplicationInfo.errmsg

Returns the last error status.

db.getReplicationInfo.oplogMainRowCount

Returns a counter of the number of items or rows (i.e. documents) in the oplog.

Secondary Nodes

The following fields appear in the output of db.getReplicationInfo() for secondary nodes.

db.getReplicationInfo.timeDiff

Returns the difference between the first and last operation in the oplog, represented in seconds.

db.getReplicationInfo.timeDiffHours

Returns the difference between the first and last operation in the oplog, rounded and represented in hours.

db.getReplicationInfo.tFirst

Returns a time stamp for the first (i.e. earliest) operation in the oplog. Compare this value to the last write operation issued against the server.

db.getReplicationInfo.tLast

Returns a time stamp for the last (i.e. latest) operation in the oplog. Compare this value to the last write operation issued against the server.

db.getReplicationInfo.now

Returns a time stamp reflecting 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. Equivalent to Date().

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务