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"
    }
  }
}
相关推荐
G皮T12 小时前
【Elasticsearch】深度分页及其替代方案
大数据·elasticsearch·搜索引擎·scroll·检索·深度分页·search_after
G皮T15 小时前
【Elasticsearch】检索排序 & 分页
大数据·elasticsearch·搜索引擎·排序·分页·检索·深度分页
飞询18 小时前
Docker 安装 Elasticsearch 9
elasticsearch·docker
G皮T19 小时前
【Elasticsearch】检索高亮
大数据·elasticsearch·搜索引擎·全文检索·kibana·检索·高亮
大只鹅1 天前
解决 Spring Boot 对 Elasticsearch 字段没有小驼峰映射的问题
spring boot·后端·elasticsearch
HGW6892 天前
基于 Elasticsearch 实现地图点聚合
java·elasticsearch·高德地图
小袁拒绝摆烂2 天前
ElasticSearch快速入门-1
大数据·elasticsearch·搜索引擎
GISer_Jing2 天前
Git协作开发:feature分支、拉取最新并合并
大数据·git·elasticsearch
高山莫衣3 天前
git rebase多次触发冲突
大数据·git·elasticsearch
kobe_OKOK_3 天前
【团队开发】git 操作流程
git·elasticsearch·团队开发