- Reference >
mongoShell Methods >- Replication Methods >
- rs.printReplicationInfo()
rs.printReplicationInfo()¶
On this page
Definition¶
-
rs.printReplicationInfo()¶ New in version 2.6.
Prints a formatted report of the replica set member’s oplog. The displayed report formats the data returned by
db.getReplicationInfo(). [1] The output ofrs.printReplicationInfo()is identical to that ofdb.printReplicationInfo().Note
The
rs.printReplicationInfo()in themongoshell does not return JSON. Users.printReplicationInfo()for manual inspection, anddb.getReplicationInfo()in scripts.
Output Example¶
The following example is a sample output from the
rs.printReplicationInfo() method run on the primary:
Output Fields¶
rs.printReplicationInfo() formats and prints the data returned by
db.getReplicationInfo():
- configured oplog size
- Displays the
db.getReplicationInfo.logSizeMBvalue. - log length start to end
- Displays the
db.getReplicationInfo.timeDiffanddb.getReplicationInfo.timeDiffHoursvalues. - 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.
| [1] | If run on a slave of a master-slave replication, the method calls
db.printSlaveReplicationInfo(). See
db.printSlaveReplicationInfo() for details. |