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"
    }
  }
}
相关推荐
Elasticsearch9 小时前
两行,一个文档:在 Logstash 中配对 Elasticsearch 批量操作
elasticsearch
顧棟21 小时前
Elasticsearch LifecycleComponent 组件生命周期设计分析
大数据·elasticsearch
Elasticsearch1 天前
在 Kibana Agent Builder 中创建 Agent,并为它添加自定义 Skill
elasticsearch
Elasticsearch1 天前
使用 EDOT 安卓版衡量移动应用的服务级别目标:Elastic 可观测性中的无崩溃会话与应用无响应事件
elasticsearch
Elasticsearch1 天前
从分散搜索到即时洞察:Iron Mountain 为何选择 Elastic 统一企业搜索
elasticsearch
凉、介1 天前
Git 深入理解(二) | 常用命令
大数据·git·elasticsearch
Elasticsearch1 天前
Elastic 与 AWS DevOps Agent 集成:利用完整上下文实现自动化事件响应
elasticsearch
Elasticsearch1 天前
无须管道,无须复制数据:在 Elasticsearch 中使用 ES|QL 查询 Amazon S3
elasticsearch
Elasticsearch2 天前
安全负责人如何看待人工智能在安全运营中心(SOC)的应用
elasticsearch
Elasticsearch2 天前
Elastic 可观测性 9.6 新功能:APM 中的人工智能原生应用调查与大语言模型追踪、人工智能站点可靠性工程师,以及将告警作为数据
elasticsearch