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

获取具有复制健康状况的主机

The v2.0 versions of the three Get Host endpoints return everything the v1.0 endpoints return. They add two fields that report a replica set member's replication health. Use these endpoints to detect a member that is too stale to catch up and to read its replication error.

Adding fields to an existing response can break clients that validate the schema strictly. The v1.0 endpoints are unchanged and never return these fields.

Before you use the v2.0 Get Host resources, review the following requirements.

注意

注意:群组和项目是同义词。您的 {PROJECT-ID} 与您的项目 ID 相同。对于现有群组,群组/项目 ID 保持不变。当引用说明时,此页面将使用“群组”这个更为人熟知的术语。终结点仍如文档中所述。

基本 URL: https://{OPSMANAGER-HOST}:{PORT}/api/public/v2.0

To use the v2.0 Get Host resources, you must be an Ops Manager user with at least the Project Read Only role.

Your deployment must run Ops Manager 8.0.28 or 9.0.2 or later. Monitoring must be enabled for the project. If monitoring is disabled, Ops Manager omits the new fields.

The following table lists the endpoints available for the v2.0 Get Host resources. The paths match the v1.0 endpoints under the v2.0 base URL.

方法
端点
说明

GET

通过唯一标识符返回一个主机。

GET

通过主机名和端口返回一个主机。

GET

返回项目中的所有主机。

The v2.0 endpoints return the following fields in addition to the v1.0 response fields.

名称
类型
说明

太陈旧了

布尔

true 如果该成员的进程落后于操作日志窗口且无法追赶,则该成员需要进行初始同步。

最后一次复制错误

字符串

The member's last replication error, from the errmsg field of rs.status().

Both fields describe this host's own member entry in its replica set. Ops Manager omits them for hosts that aren't replica set members, and omits lastReplError when the member reports no error.

1
2

If tooStale is true, the member cannot catch up from the replica set's oplog and requires an initial sync.

3

lastReplError 携带成员复制错误消息。