rs.printSlaveReplicationInfo()

On this page本页内容

Definition定义

rs.printSlaveReplicationInfo()

Deprecated since version 4.4.1:自版本4.4.1以来已弃用: Use rs.printSecondaryReplicationInfo() instead.请改用rs.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 db.printSlaveReplicationInfo().输出与db.printSlaveReplicationInfo()的输出相同。

Output输出

The following is example output from the rs.printSlaveReplicationInfo() method issued on a replica set with two secondary members:以下是rs.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

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秒。

A member may show a negative time value behind the primary when rs.printSlaveReplicationInfo() is called. 当调用rs.printSlaveReplicationInfo()时,成员可能会在主文件后面显示负时间值。This behavior is expected if the method is called after a secondary replicates a write following a period of inactivity, but before it has received a heartbeat from the primary with its latest optime.如果在一段非活动时间后,在辅助复制写入之后,但在它收到来自主的带有最新optime的心跳信号之前调用该方法,则会出现这种行为。

Note注意

The lag reported by secondaries may not be representative of cluster health. 二级报告的滞后可能不能代表集群健康状况。Negative values do not indicate that the secondary is ahead of the primary.负值并不表示辅助设备领先于主设备。

For the most up-to-date information on your replica set, it is generally advisable to run rs.printSlaveReplicationInfo() on the primary.有关副本集的最新信息,通常建议在主副本集上运行rs.printSlaveReplicationInfo()

←  rs.printSecondaryReplicationInfo()rs.reconfig() →