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"
    }
  }
}
相关推荐
咸鱼求放生9 小时前
es在Linux安装
大数据·elasticsearch·搜索引擎
xyhshen10 小时前
k8s下离线搭建elasticsearch
elasticsearch·容器·kubernetes
@泽栖14 小时前
ES数据聚合
elasticsearch·搜索引擎
張萠飛18 小时前
Linux下如何使用shell脚本导出elasticsearch中某一个index的数据为本地csv文件
linux·运维·elasticsearch
LanLance20 小时前
ES101系列09 | 运维、监控与性能优化
java·运维·后端·elasticsearch·云原生·性能优化·golang
疯狂的沙粒1 天前
如何通过git命令查看项目连接的仓库地址?
大数据·git·elasticsearch
IT成长日记1 天前
Elasticsearch集群手动分片分配指南:原理与实践
大数据·elasticsearch·手动分片分配
Elastic 中国社区官方博客2 天前
Elastic 获得 AWS 教育 ISV 合作伙伴资质,进一步增强教育解决方案产品组合
大数据·人工智能·elasticsearch·搜索引擎·云计算·全文检索·aws
Tom Boom2 天前
Git常用命令完全指南:从入门到精通
大数据·git·elasticsearch·docker·自动化测试框架
星星点点洲2 天前
【Elasticsearch】 查询优化方式
elasticsearch·搜索引擎