rs.printReplicationInfo()

On this page本页内容

Definition定义

rs.printReplicationInfo()

Prints a formatted report of the replica set member's oplog. 打印副本集成员oplog的格式化报告。The displayed report formats the data returned by db.getReplicationInfo(). 显示的报告将格式化db.getReplicationInfo()返回的数据。The output of rs.printReplicationInfo() is identical to that of db.printReplicationInfo().rs.printReplicationInfo()的输出与db.printReplicationInfo()的相同。

Note注意

The rs.printReplicationInfo() method run in mongosh does not return JSON. mongosh中运行的rs.printReplicationInfo()方法不返回JSONUse rs.printReplicationInfo() for manual inspection, and db.getReplicationInfo() in scripts.使用rs.printReplicationInfo()进行手动检查,并在脚本中使用db.getReplicationInfo()

Output Example输出示例

The following example is a sample output from the rs.printReplicationInfo() method run on the primary:以下示例是在主服务器上运行的rs.printReplicationInfo()方法的示例输出:

configured oplog size:   192MB
log length start to end: 65422secs (18.17hrs)
oplog first event time:  Mon Jun 23 2014 17:47:18 GMT-0400 (EDT)
oplog last event time:   Tue Jun 24 2014 11:57:40 GMT-0400 (EDT)
now:
                     Thu Jun 26 2014 14:24:39 GMT-0400 (EDT)

Output Fields输出字段

rs.printReplicationInfo() formats and prints the data returned by db.getReplicationInfo():格式化并打印db.getReplicationInfo()返回的数据:

configured oplog size配置的oplog大小
Displays the db.getReplicationInfo.logSizeMB value.显示db.getReplicationInfo.logSizeMB值。
log length start to end从开始到结束的日志长度
Displays the db.getReplicationInfo.timeDiff and db.getReplicationInfo.timeDiffHours values.显示db.getReplicationInfo.timeDiffdb.getReplicationInfo.timeDiffHours值。
oplog first event timeoplog首次事件时间
Displays the db.getReplicationInfo.tFirst.显示db.getReplicationInfo.tFirst
oplog last event timeoplog上次事件时间
Displays the db.getReplicationInfo.tLast.显示db.getReplicationInfo.tLast
now
Displays the db.getReplicationInfo.now.显示db.getReplicationInfo.now

See db.getReplicationInfo() for description of the data.有关数据的描述,请参阅db.getReplicationInfo()

←  rs.initiate()rs.printSecondaryReplicationInfo() →