rs.printReplicationInfo()

在本页面

Definition

打印副本集成员的oplog的格式化报告。显示的报告会格式化db.getReplicationInfo()返回的数据。 [1] rs.printReplicationInfo()的输出与db.printReplicationInfo()的输出相同。

Note

mongo shell 中的rs.printReplicationInfo()不**返回JSON。使用rs.printReplicationInfo()进行手动检查,并使用db.getReplicationInfo()编写脚本。

Output Example

以下示例是在主要数据库上运行的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()格式化并打印db.getReplicationInfo()返回的数据:

有关数据的说明,请参见db.getReplicationInfo()

[1] 如果在master-slave replication的从属服务器上运行,则该方法将调用db.printSlaveReplicationInfo()。有关详细信息,请参见db.printSlaveReplicationInfo()
首页