对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

db.printSecondaryReplicationInfo()(mongosh方法)

db.printSecondaryReplicationInfo()

从副本集的从节点成员的角度打印副本集状态的格式化报告。 输出与rs.printSecondaryReplicationInfo()方法相同。

此方法可用于以下环境中托管的部署:

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

重要

This command is not supported in M0 and Flex clusters. For more information, see Unsupported Commands.

Example db.printSecondaryReplicationInfo() output when run on a replica set with two secondary members:

source: m1.example.net:27002
{
syncedTo: 'Mon Mar 01 2021 16:30:50 GMT-0800 (PST)',
replLag: '0 secs (0 hrs) behind the primary '
}
---
source: m2.example.net:27003
{
syncedTo: 'Mon Mar 01 2021 16:30:50 GMT-0800 (PST)',
replLag: '0 secs (0 hrs) behind the primary '
}

注意

The db.printSecondaryReplicationInfo() method run in mongosh does not return JSON. Use db.printSecondaryReplicationInfo() for manual inspection, and rs.status() in scripts.

当主节点上的不活动时段大于 members[n].secondaryDelaySecs 值可能会显示为落后于主节点 0 秒。

A member may show a negative time value behind the primary when db.printSecondaryReplicationInfo() is run. This is expected if db.printSecondaryReplicationInfo() is run after a secondary replicates a write that follows a period of inactivity, but before the secondary receives a heartbeat from the primary with the latest optime.

注意

从节点报告的延迟可能无法代表集群的运行状况。 负值并不表示从节点领先于主节点。

To obtain the most current status for your replica set, run db.printSecondaryReplicationInfo() on the primary.

给本页内容打分

在此页面上