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"
    }
  }
}
相关推荐
Elasticsearch4 天前
Elastic Observability 的跨项目搜索:通过一个查询搜索所有关联项目
elasticsearch
Elasticsearch4 天前
Elasticsearch 中的 agentic 工作流:暂停 AI agent 等待人工审批,72 小时后恢复
elasticsearch
Elastic 中国社区官方博客4 天前
jina-ocr-v1:在低成本 GPU 上实现更快速的文档解析
大数据·数据库·elasticsearch·搜索引擎·全文检索·jina
vx-程序开发5 天前
【计算机毕设】django校园跑腿服务系统83141
java·数据库·vue.js·spring boot·spring·elasticsearch·django
Elasticsearch5 天前
jina-ocr-v1:在低成本 GPU 上实现更快速的文档解析
elasticsearch
深海鱼肝油ya5 天前
向量数据库Elasticsearch(四)搜索文档——各种方式
人工智能·elasticsearch·向量数据库·es搜索文档·只能体·非结构化数据库
Elasticsearch5 天前
SNAP 支付错误检测:Elastic 如何帮助美国各州应对 FY2028 的处罚
elasticsearch
Elastic 中国社区官方博客5 天前
使用 Elasticsearch 和 Jina 进行 AI 视频搜索:精准找到你需要的视频片段秒数
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
Elasticsearch5 天前
2026 年唯一获得满分 Endpoint Prevention and Response(EPR)评分的是 Elastic
elasticsearch
Elasticsearch6 天前
没有小到无法记录的日志文件:Elastic Agent 如何跟踪低于 1 KiB 阈值的文件
elasticsearch