OPTIONS
翻译或纠错本页面

rs.printReplicationInfo()

rs.printReplicationInfo()

2.6 新版功能.

Prints a formatted report of the status of a replica set from the perspective of the primary member of the set if run on the primary. [1] The displayed report formats the data returned by db.getReplicationInfo().

注解

The rs.printReplicationInfo() in the mongo shell does not return JSON. Use rs.printReplicationInfo() for manual inspection, and db.getReplicationInfo() in scripts.

The output of rs.printReplicationInfo() is identical to that of db.printReplicationInfo().

[1]If run on a secondary, the method calls db.printSlaveReplicationInfo(). See db.printSlaveReplicationInfo() for details.

Output Example

The following example is a sample output from the rs.printReplicationInfo() method run on the primary:

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():

configured oplog size
Displays the db.getReplicationInfo.logSizeMB value.
log length start to end
Displays the db.getReplicationInfo.timeDiff and db.getReplicationInfo.timeDiffHours values.
oplog first event time
Displays the db.getReplicationInfo.tFirst.
oplog last event time
Displays the db.getReplicationInfo.tLast.
now
Displays the db.getReplicationInfo.now.

See db.getReplicationInfo() for description of the data.