ElasticSearch的REST APIs 之 索引的监控(monitoring)

基于ES7.7 官方文档

内容包括:

  • 索引的统计信息 (Index stats)
  • 索引的段 (Index segments)
  • 索引的恢复信息 (Index recovery)
  • 索引分片的存储 (Index shard stores)

索引的统计信息 (Index stats API)

获取索引的统计信息。官方文档

GET /<index>/_stats
GET /<index>/_stats/<index-metric>
GET /_stats

使用索引的统计API来获取索引的高级聚合和统计信息。

默认情况下,返回的统计信息是索引级别(index-level)的,包含primariestotal聚合。 primaries只是主分片(primary shards)的信息,total是主分片和副本分片(replica shards)的累加。

要获取分片级(shard-level)的统计信息,请将level参数设置为shards

当移动到另一个节点时,该分片的分片级统计信息将从原节点清除。 尽管该分片不再是原节点的一部分,但该原节点仍保留了这个分片的所有节点级(node-level)统计信息。

路径参数

<index>

  (可选, string) 索引名称,支持多个索引名称的英文逗号分割、通配符表达式。如果要获取所有索引的统计信息,使用all*或干脆直接忽略这个参数。

<index-metric>

  (可选, string) 索引的指标,支持多个索引名称的英文逗号分割。可选的指标包括:

  • all 返回所有统计信息
  • completion 自动完成建议(Completion suggester) 的统计信息。是有关自动完成(auto-complete)、即时搜索(search-as-you-type)的统计信息
  • docs 文档及已删除但尚未合并的文档的数量。 索引刷新(index refreshes)会影响这个统计数据。
  • fielddata 字段数据(fielddata)的统计信息。
  • flush 刷数据到磁盘(flush)统计信息
  • get et的统计信息, 包括丢失的(missing)统计信息。
  • indexing 索引(indexing)统计信息
  • merge 合并(merge)统计信息
  • query_cache: 查询缓存(query cache) 统计信息
  • refresh 刷缓存数据到操作系统缓存(refresh)统计信息
  • request_cache 分片请求缓存(shard request cache)统计信息
  • search 搜索的统计信息包括建议(suggest)的统计。可以通过添加额外的参数groups(搜索操作可以与一个或多个组关联)来包含自定义组的统计信息。 参数groups接受逗号分割的组名称列表。 使用_all返回所有组的统计信息。
  • segments 所有打开的段(segments)使用的内存。 如果参数include_segment_file_sizes设置为true,该指标会包括每个Lucene索引文件的磁盘占用的总和。
  • store 索引的大小(size), 使用字节单位(byte unit)
  • suggest [自动补全(suggester)]统计
  • translog translog统计
  • warmer warmer统计. 注: warmers已被移除,有更好的方法替代之。

查询参数

expand_wildcards

  (可选, string) 通配符查询时可以匹配的索引的条件, 多个值之间以英文逗号分割, 比如"open,hidden"。

  默认open,可用的值有:

  • all: 匹配所有open和closed的索引, 包括隐藏的(hidden).
  • open: 表示只匹配开放中的索引
  • closed: 只匹配关闭的(closed)的索引
  • hidden: 匹配隐藏的(hidden)的
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ey Features Understand common performance and reliability pitfalls in ElasticSearch Use popular monitoring tools such as ElasticSearch-head, BigDesk, Marvel, Kibana, and more This is a step-by-step guide with lots of case studies on solving real-world ElasticSearch cluster issues Book Description ElasticSearch is a distributed search server similar to Apache Solr with a focus on large datasets, a schema-less setup, and high availability. This schema-free architecture allows ElasticSearch to index and search unstructured content, making it perfectly suited for both small projects and large big data warehouses with petabytes of unstructured data. This book is your toolkit to teach you how to keep your cluster in good health, and show you how to diagnose and treat unexpected issues along the way. You will start by getting introduced to ElasticSearch, and look at some common performance issues that pop up when using the system. You will then see how to install and configure ElasticSearch and the ElasticSearch monitoring plugins. Then, you will proceed to install and use the Marvel dashboard to monitor ElasticSearch. You will find out how to troubleshoot some of the common performance and reliability issues that come up when using ElasticSearch. Finally, you will analyze your cluster's historical performance, and get to know how to get to the bottom of and recover from system failures. This book will guide you through several monitoring tools, and utilizes real-world cases and dilemmas faced when using ElasticSearch, showing you how to solve them simply, quickly, and cleanly. What you will learn Explore your cluster with ElasticSearch-head and BigDesk Access the underlying data of the ElasticSearch monitoring plugins using the ElasticSearch API Analyze your cluster's performance with Marvel Troubleshoot some of the common performance and reliability issues that come up when using ElasticSearch Analyze a cluster's historical performance, and get to the bottom of and recover from system failures Use and install various other tools and plugins such as Kibana and Kopf, which is helpful to monitor ElasticSearch About the Author Dan Noble is a software engineer with a passion for writing secure, clean, and articulate code. He enjoys working with a variety of programming languages and software frameworks, particularly Python, Elasticsearch, and frontend technologies. Dan currently works on geospatial web applications and data processing systems. Dan has been a user and advocate of Elasticsearch since 2011. He has given talks about Elasticsearch at various meetup groups, and is the author of the Python Elasticsearch client rawes. Dan was also a technical reviewer for the Elasticsearch Cookbook, Second Edition, by Alberto Paro. Table of Contents Chapter 1. Introduction to Monitoring Elasticsearch Chapter 2. Installation and the Requirements for Elasticsearch Chapter 3. Elasticsearch-head and Bigdesk Chapter 4. Marvel Dashboard Chapter 5. System Monitoring Chapter 6. Troubleshooting Performance and Reliability Issues Chapter 7. Node Failure and Post-Mortem Analysis Chapter 8. Looking Forward

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值