AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.

호스트 가져오기 API를 통해 복제 상태를 읽어보세요.

Ops Manager API를 사용하면 복제 세트 멤버가 따라잡을 수 없을 정도로 뒤처졌는지 여부를 확인할 수 있습니다. 또한 해당 멤버의 마지막 복제 오류를 확인할 수도 있습니다.

Ops Manager adds two fields to the host document, tooStale and lastReplError, and returns them from new v2.0 versions of the three Get Host endpoints. The v1.0 endpoints are unchanged and never return the new fields.

To call these endpoints, you must have the Project Read Only role.

item
세부 정보

새로운 엔드포인트

v2.0 versions of Get One Host by ID, Get One Host by Hostname and Port, and Get All Hosts. Same paths as v1.0 under /api/public/v2.0.

새로운 분야

tooStale and lastReplError on the host document.

기존 엔드포인트

v1.0 is unchanged, including the hosts endpoints in the Admin API.

  • Your deployment must run Ops Manager 8.0.28 or 9.0.2 or later.

  • 프로젝트에 대한 모니터링이 활성화되어 있어야 합니다. 모니터링이 비활성화된 경우 Ops Manager는 새 필드를 생략합니다.

  • Change the base path of your requests from /api/public/v1.0 to /api/public/v2.0. The rest of each request is unchanged.

1

Use v2.0 Get All Hosts to list hosts, or use the hostname:port you already know.

2
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --include \ --request GET "https://<OpsManagerHost>:<Port>/api/public/v2.0/groups/{GROUP-ID}/hosts/byName/{HOSTNAME-PORT}?pretty=true"
3
{ "hostname": "node1.example.com", "port": 27017, "replicaSetName": "rs0", "replicaStateName": "RECOVERING", "tooStale": true, "lastReplError": "error RS102 too stale to catch up"}

문서의 간결성을 위해 내용이 일부 삭제되었습니다. Ops Manager는 호스트 문서의 전체 내용을 반환합니다.

이름
유형
설명

너무 오래됐어

부울

해당 멤버는 oplog 윈도우를 따라잡지 못하고 복제본 세트에서 동기화를 완료하지 못했습니다. 따라서 초기 동기화가 필요합니다.

lastReplError

문자열

The member's last replication error, from rs.status().

다음 표는 Ops Manager가 특정 시나리오에서 새 필드를 채우는 방법을 설명합니다.

Scenario
행동

호스트는 건강한 복제 세트 멤버입니다.

tooStale is false. lastReplError is omitted.

멤버가 oplog 창 뒤에 있습니다.

tooStale is true. lastReplError carries the mongod's message.

호스트는 복제 세트 멤버가 아닙니다.

두 항목 모두 생략되었습니다.

Request uses a v1.0 endpoint

두 항목 모두 생략되었습니다.

모든 호스트 가져오기

각 호스트는 복제 세트의 값이 아닌 자체 구성원의 값을 보고합니다.

두 필드 모두 전체 복제 세트가 아닌 응답에 포함된 단일 호스트를 설명합니다.

The following table describes common errors and symptoms when you use the v2.0 Get Host endpoints.

증상
가능한 원인
해상도

404 from a v2.0 endpoint

The base path is /api/public/v1.0, or the host isn't in the project.

Use /api/public/v2.0 and confirm the host with v2.0 Get All Hosts.

tooStale and lastReplError are missing

The host isn't a replica set member, monitoring is disabled, or you called a v1.0 endpoint.

Confirm the host belongs to a replica set, monitoring is enabled, and the path uses v2.0.

lastReplError is missing but tooStale is present

해당 회원은 복제 오류가 없다고 보고했습니다.

별도의 조치가 필요하지 않습니다.

404 HOST_NOT_FOUND

HOST-ID or HOSTNAME-PORT doesn't match a host in the project.

Confirm the value with v2.0 Get All Hosts.

복제 상태를 프로그래밍 방식으로 확인하려면 복제 상태를 사용하여 호스트 가져오기를 참조하세요.