CAT Health API
CAT health 연산은 클러스터의 상태, 클러스터가 얼마나 오래 가동됐는지, 노드 수 등 클러스터의 건강 상태를 분석하는 데 유용한 정보를 나열해 줘요.
출처: OpenSearch 문서
본문
Endpoints
GET /_cat/health
Query parameters
다음 표는 사용 가능한 쿼리 파라미터를 보여줘요. 모든 쿼리 파라미터는 선택사항이에요.
| Parameter | Data type | Description | Default | | format | String | A short version of the Accept header, such as json or yaml. | N/A | | h | List | A comma-separated list of column names to display. | N/A | | help | Boolean | Returns help information. | false | | s | List | A comma-separated list of column names or column aliases to sort by. | N/A | | time | String | The unit used to display time values. Valid values are: nanos, micros, ms, s, m, h, and d. | N/A | | ts | Boolean | When true, returns HH:MM:SS and Unix epoch timestamps. | true | | v | Boolean | Enables verbose mode, which displays column headers. | false |
Example request
다음 예시 요청은 지난 5일간의 클러스터 헬스 정보를 보여줘요.
REST Python
GET /_cat/health?v&time=5d
Copy Copy as cURL
response = client.cat.health(
params = { "v": "true", "time": "5d" }
)
Copy
Example response
GET _cat/health?v&time=5d
epoch | timestamp | cluster | status | node.total | node.data | shards | pri | relo | init | unassign | pending_tasks | max_task_wait_time | active_shards_percent
1624248112 | 04:01:52 | odfe-cluster | green | 2 | 2 | 16 | 8 | 0 | 0 | 0 | 0 | - | 100.0%
Required permissions
Security 플러그인을 사용한다면 적절한 권한(cluster:monitor/health)을 가지고 있는지 확인하세요.