29-Elasticsearch 集群监控

Elasticsearch Stats 相关的 API

● Elasticsearch 提供了多个监控相关的 API

Node Stats: _nodes/stats

Cluster Stats: _cluster/stats

Index Stats: index_name/_stats

Elasticsearch Task API

● 查看 Task 相关的 API

Pending Cluster Tasks API: GET _cluster/pending_tasks

Task Management API:GET _tasks (可以用来 Cancel 一个 Task)

● 监控 Thread Pools

○ GET _nodes/thread_pool

○ GET _nodes/stats/thread_pool

○ GET _cat/thread_pool?v

○ GET _nodes/hot_threads

The Index & Query Slow Log

● 支持将分片上, Search 和 Fetch 阶段的慢 查询写入文件

● 支持为 Query 和 Fetch 分别定义阈值

● 索引级的动态设置,可以按需设置,或者通过Index Template 统一设定

● Slow log 文件通过 log4j2.properties 配 置

复制代码
# 设置 Index Slowlogs
# the first 1000 characters of the doc's source will be logged
PUT my_index/_settings
{
  "index.indexing.slowlog":{
    "threshold.index":{
      "warn":"10s",
      "info": "4s",
      "debug":"2s",
      "trace":"0s"
    },
    "level":"trace",
    "source":1000  
  }
}

# 设置查询
DELETE my_index
//"0" logs all queries
PUT my_index/
{
  "settings": {
    "index.search.slowlog.threshold": {
      "query.warn": "10s",
      "query.info": "3s",
      "query.debug": "2s",
      "query.trace": "0s",
      "fetch.warn": "1s",
      "fetch.info": "600ms",
      "fetch.debug": "400ms",
      "fetch.trace": "0s"
    }
  }
}
相关推荐
Han.miracle1 天前
Elasticsearch深度分页问题完整解析
大数据·elasticsearch·搜索引擎
深海鱼肝油ya1 天前
向量数据库Elasticsearch(一)
人工智能·elasticsearch·向量数据库·es数据库增加索引·es数据库相似度查询·knn查询
大模型丫丫1 天前
工业级 RAG 为什么需要 Elasticsearch?
elasticsearch·django·jenkins
Sayai1 天前
Elasticsearch 9 安装验证实战:start-local 一键部署 + Docker 手动安装踩坑指南
大数据·elasticsearch·docker
瑞码空间2 天前
git知识点黄金笔记
笔记·git·elasticsearch
切糕师学AI2 天前
如何查看已合并到 master 分支的所有分支?Git 分支清理指南
大数据·git·elasticsearch
suaizai_2 天前
从1210条报错到全自动修复:AI闭环运维实战
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客2 天前
不再有分配延迟:在无状态 Elasticsearch 中将快照与分片迁移解耦
大数据·运维·人工智能·elasticsearch·搜索引擎·全文检索
Elasticsearch2 天前
在 ES|QL 中引入 SPARKLINE:一眼看清趋势
elasticsearch
Capricorn19883 天前
防编造架构实战:对比 Gemini Notebook 解析知芽 Notebook Skill 的工程实现
人工智能·笔记·elasticsearch·架构·知识图谱·论文笔记