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"
    }
  }
}
相关推荐
在未来等你4 小时前
Elasticsearch面试精讲 Day 17:查询性能调优实践
大数据·分布式·elasticsearch·搜索引擎·面试
在未来等你17 小时前
Elasticsearch面试精讲 Day 18:内存管理与JVM调优
大数据·分布式·elasticsearch·搜索引擎·面试
Elasticsearch17 小时前
在 Elastic Observability 中使用 Discover 的追踪获取更深入的应用洞察
elasticsearch
婲落ヽ紅顏誶18 小时前
测试es向量检索
大数据·elasticsearch·搜索引擎
咖啡Beans1 天前
Docker安装ELK(Elasticsearch + Logstash + Kibana)
后端·elasticsearch·docker
一勺菠萝丶1 天前
Jenkins 构建 Node 项目报错解析与解决——pnpm lockfile 问题实战
elasticsearch·servlet·jenkins
小花鱼20251 天前
Elasticsearch (ES)相关
大数据·elasticsearch
阿里嘎多哈基米2 天前
ES——(三)DSL高级查询
elasticsearch·搜索引擎·全文检索·kibana·倒排索引
AAA修煤气灶刘哥2 天前
ES 高级玩法大揭秘:从算分骚操作到深度分页踩坑,后端 er 速进!
java·后端·elasticsearch
island13142 天前
【C++框架#5】Elasticsearch 安装和使用
开发语言·c++·elasticsearch