English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
클러스터 API는 클러스터 및 노드에 대한 정보를 얻고 변경하기 위해 사용됩니다. 이 API를 호출하려면 노드 이름, 주소 또는 _local을 지정해야 합니다.
GET /_nodes/_local
위의 코드를 실행한 후, 다음과 같은 응답을 받습니다:
……………………………………………… "cluster_name" : "elasticsearch", "nodes": { FKH-5blYTJmff2rJ_lQOCg": { "name": "ubuntu", "transport_address": ""127.0.0.1:9300", "host": ""127.0.0.1", "ip": ""127.0.0.1", "version" : "7.0.0", "build_flavor" : "default", "build_type" : "tar", "build_hash" : "b7e28a7", "total_indexing_buffer" : 106502553, "roles": [ "master", "data", "ingest" ], "attributes": { ………………………………………………
API는 'health' 키워드를 추가하여 클러스터의 상태를 얻기 위해 사용됩니다.
GET /_cluster/health
위의 코드를 실행한 후, 다음과 같은 응답을 받습니다:
{ "cluster_name": "elasticsearch", "status": "yellow", "timed_out" : false, "number_of_nodes" : 1, "number_of_data_nodes" : 1, "active_primary_shards" : 7, "active_shards" : 7, "relocating_shards" : 0, "initializing_shards" : 0, "unassigned_shards" : 4, "delayed_unassigned_shards" : 0, "number_of_pending_tasks" : 0, "number_of_in_flight_fetch" : 0, "task_max_waiting_in_queue_millis" : 0, "active_shards_percent_as_number" : 63.63636363636363 }
이 API는 'state' 키워드를 추가한 URL을 통해 클러스터의 상태 정보를 얻기 위해 사용됩니다. 상태 정보는 버전, 마스터 노드, 다른 노드, 라우팅 테이블, 메타데이터 및 블록을 포함합니다.
GET /_cluster/state
위의 코드를 실행한 후, 다음과 같은 응답을 받습니다:
……………………………………………… { "cluster_name": "elasticsearch", "cluster_uuid": "IzKu0OoVTQ"6LxqONJnN2eQ" "version" : 89, "state_uuid" : "y3BlwvspR1eUQBTo0aBjig", "master_node" : "FKH-5blYTJmff2rJ_lQOCg", "blocks" : { }, "nodes": { FKH-5blYTJmff2rJ_lQOCg": { "name": "ubuntu", "ephemeral_id" : "426kTGpITGixhEzaM-5Qyg", "transport } ………………………………………………
이 API는 'stats' 키워드를 사용하여 클러스터의 통계 정보를 검색하는 데 도움을 줍니다. 이 API는 스플릿 번호, 저장 공간 크기, 메모리 사용률, 노드 수, 역할, 운영 체제 및 파일 시스템에 대한 정보를 반환합니다.
GET /_cluster/stats
위의 코드를 실행한 후, 다음과 같은 응답을 받습니다:
…………………………………………. "cluster_name": "elasticsearch", "cluster_uuid": "IzKu0OoVTQ"6LxqONJnN2eQ" "timestamp": 1556435464704, "status": "yellow", "indices": { "count": 7, "shards": { "total": 7, "primaries": 7, "replication": 0.0, "index": { "shards": { "min": 1, "max": 1, "avg": 1.0 }, "primaries": { "min": 1, "max": 1, "avg": 1.0 }, "replication": { "min": 0.0, "max": 0.0, "avg": 0.0 } ………………………………………….
이 API를 사용하여 "설정" 키워드를 사용하여 클러스터 설정을 업데이트할 수 있습니다. 두 가지 유형의 설정이 있습니다.-고정성(재시작에서 적용)과 일시적(전체 클러스터 재시작 후 생존하지 못하는)입니다.
이 API는 클러스터 내 다른 노드의 통계 정보를 검색하는 데 사용됩니다. 노드 통계 정보는 클러스터와 거의 같습니다.
GET /_nodes/stats
위의 코드를 실행한 후, 다음과 같은 응답을 받습니다:
{ "_nodes": { "total": 1, "successful": 1, "failed": 0 }, "cluster_name": "elasticsearch", "nodes": { FKH-5blYTJmff2rJ_lQOCg": { "timestamp": 1556437348653, "name": "ubuntu", "transport_address": ""127.0.0.1:9300", "host": ""127.0.0.1", "ip": ""127.0.0.1:9300", "roles": [ "master", "data", "ingest" ], "attributes": { "ml.machine_memory": ""4112797696", "xpack.installed": "true", "ml.max_open_jobs": ""20" }, ………………………………………………………….
이 API는 클러스터 내 각 노드에서 현재 핵심 스레드에 대한 정보를 검색하는 데 도움을 줍니다.
GET /_nodes/hot_threads
위의 코드를 실행한 후, 다음과 같은 응답을 받습니다:
:::{ubuntu}{FKH-5blYTJmff2rJ_lQOCg}{426kTGpITGixhEzaM5Qyg}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4112797696, xpack.installed=true, ml.max_open_jobs=20} Hot threads at 2019-04-28T07:43:58.265Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true: