Docs HomeMongoDB Manual

db.printSlaveReplicationInfo()

On this page本页内容

Definition定义

db.printSlaveReplicationInfo()

Deprecated since version 4.4.1:自4.4.1版起弃用: Use db.printSecondaryReplicationInfo() instead.请改用db.printSecondaryReplicationInfo()

Returns a formatted report of the status of a replica set from the perspective of the secondary member of the set. 从副本集的secondary成员的角度返回副本集状态的格式化报告。The output is identical to that of rs.printSlaveReplicationInfo().输出与rs.printSlaveReplicationInfo()的输出相同。

Output输出

The following is example output from the db.printSlaveReplicationInfo() method issued on a replica set with two secondary members:以下是在具有两个辅助成员的副本集上发出的db.printSlaveReplicationInfo()方法的输出示例:

source: m1.example.net:27017
syncedTo: Thu Apr 10 2014 10:27:47 GMT-0400 (EDT)
0 secs (0 hrs) behind the primary
source: m2.example.net:27017
syncedTo: Thu Apr 10 2014 10:27:47 GMT-0400 (EDT)
0 secs (0 hrs) behind the primary
Note

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

A delayed member may show as 0 seconds behind the primary when the inactivity period on the primary is greater than the members[n].secondaryDelaySecs value.当主成员的不活动时间大于members[n].secondaryDelaySecs值时,延迟成员可能显示为比主成员晚0秒。