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. 副本集辅助成员的角度返回副本集状态的格式化报告。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()方法返回JSONUse 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秒。

←  db.printShardingStatus()db.resetError() →