Definition定义
db.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 ofdb.printReplicationInfo()is identical to that ofrs.printReplicationInfo().db.printReplicationInfo()的输出与rs.printReplicationInfo()相同。Note
The在db.printReplicationInfo()method run inmongoshdoes not return JSON.mongosh中运行的db.printReplicationInfo()方法不返回JSON。Use使用db.printReplicationInfo()for manual inspection, anddb.getReplicationInfo()in scripts.db.printReplicationInfo()进行手动检查,在脚本中使用db.getReplicationInfo()。
Output Example输出示例
The following example is a sample output from the 以下示例是在主服务器上运行的db.printReplicationInfo() method run on the primary:db.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输出字段
db.printReplicationInfo() formats and prints the data returned by db.getReplicationInfo():db.printReplicationInfo()格式化并打印db.getReplicationInfo()返回的数据:
configured oplog size配置的oplog大小Displays the显示db.getReplicationInfo().logSizeMBvalue.db.getReplicationInfo().logSizeMB值。log length start to end日志长度从开始到结束Displays the显示db.getReplicationInfo().timeDiffanddb.getReplicationInfo().timeDiffHoursvalues.db.getReplicationInfo().timeDiff和db.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()。
Compatibility兼容性
This method is available in deployments hosted in the following environments:此方法在以下环境中托管的部署中可用:
- MongoDB Atlas
: The fully managed service for MongoDB deployments in the cloud:云中MongoDB部署的完全托管服务
Note
This command is supported in all MongoDB Atlas clusters. 所有MongoDB Atlas集群都支持此命令。For information on Atlas support for all commands, see Unsupported Commands.有关Atlas支持所有命令的信息,请参阅不支持的命令。
- MongoDB Enterprise
: The subscription-based, self-managed version of MongoDB:MongoDB的基于订阅的自我管理版本 - MongoDB Community
: The source-available, free-to-use, and self-managed version of MongoDB:MongoDB的源代码可用、免费使用和自我管理版本