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 |
새로운 분야 |
|
기존 엔드포인트 | 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.0to/api/public/v2.0. The rest of each request is unchanged.
멤버의 복제 상태를 확인하세요
호스트를 찾으세요.
Use v2.0 Get All Hosts to list hosts, or use the hostname:port you already know.
새 필드
이름 | 유형 | 설명 |
|---|---|---|
너무 오래됐어 | 부울 | 해당 멤버는 oplog 윈도우를 따라잡지 못하고 복제본 세트에서 동기화를 완료하지 못했습니다. 따라서 초기 동기화가 필요합니다. |
lastReplError | 문자열 | The member's last replication error, from |
현장 행동
다음 표는 Ops Manager가 특정 시나리오에서 새 필드를 채우는 방법을 설명합니다.
Scenario | 행동 |
|---|---|
호스트는 건강한 복제 세트 멤버입니다. |
|
멤버가 oplog 창 뒤에 있습니다. |
|
호스트는 복제 세트 멤버가 아닙니다. | 두 항목 모두 생략되었습니다. |
Request uses a v1.0 endpoint | 두 항목 모두 생략되었습니다. |
모든 호스트 가져오기 | 각 호스트는 복제 세트의 값이 아닌 자체 구성원의 값을 보고합니다. |
두 필드 모두 전체 복제 세트가 아닌 응답에 포함된 단일 호스트를 설명합니다.
문제 해결
The following table describes common errors and symptoms when you use the v2.0 Get Host endpoints.
증상 | 가능한 원인 | 해상도 |
|---|---|---|
| The base path is | Use |
| 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. |
| 해당 회원은 복제 오류가 없다고 보고했습니다. | 별도의 조치가 필요하지 않습니다. |
|
| Confirm the value with v2.0 Get All Hosts. |
API 사용
복제 상태를 프로그래밍 방식으로 확인하려면 복제 상태를 사용하여 호스트 가져오기를 참조하세요.