- Elasticsearch 教程
- Elasticsearch - 首頁
- Elasticsearch - 基本概念
- Elasticsearch - 安裝
- Elasticsearch - 資料填充
- 版本遷移
- Elasticsearch - API 約定
- Elasticsearch - 文件 API
- Elasticsearch - 搜尋 API
- Elasticsearch - 聚合
- Elasticsearch - 索引 API
- Elasticsearch - CAT API
- Elasticsearch 叢集 API
- Elasticsearch - 查詢 DSL
- Elasticsearch - 對映
- Elasticsearch - 分析
- Elasticsearch - 模組
- Elasticsearch - 索引模組
- Elasticsearch - Ingest 節點
- Elasticsearch - 管理索引生命週期
- Elasticsearch - SQL 訪問
- Elasticsearch - 監控
- Elasticsearch - 資料彙總
- Elasticsearch - 凍結索引
- Elasticsearch - 測試
- Elasticsearch - Kibana 儀表盤
- Elasticsearch - 按欄位過濾
- Elasticsearch - 資料表
- Elasticsearch - 區域地圖
- Elasticsearch - 餅圖
- Elasticsearch - 面積圖和條形圖
- Elasticsearch - 時間序列
- Elasticsearch - 詞雲
- Elasticsearch - 熱力圖
- Elasticsearch - Canvas
- Elasticsearch - 日誌 UI
- Elasticsearch 有用資源
- Elasticsearch - 快速指南
- Elasticsearch - 有用資源
- Elasticsearch - 討論
Elasticsearch 叢集 API
叢集 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" : "IzKu0OoVTQ6LxqONJnN2eQ",
"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" : "IzKu0OoVTQ6LxqONJnN2eQ",
"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 允許您使用“settings”關鍵字更新叢集的設定。設定有兩種型別:永續性設定(在重啟後應用)和瞬態設定(不會在完整的叢集重啟後保留)。
節點統計資訊
此 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:
廣告