ElasticSearch之Analyze index disk usage API
本API用于分析、统计指定index当前占用的存储空间。
考虑到本特性目前仍然处于预览状态,因此使用方法、参数等可能会发生变化,或者未来也许会被删除。
本API暂时不建议在生产系统中使用。
命令样例如下:
curl -X POST "https://localhost:9200/testindex_001/_disk_usage?run_expensive_tasks=true&pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"
执行结果的样例,如下:
{
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"testindex_001" : {
"store_size" : "249b",
"store_size_in_bytes" : 249,
"all_fields" : {
"total" : "0b",
"total_in_bytes" : 0,
"inverted_index" : {
"total" : "0b",
"total_in_bytes" : 0
},
"stored_fields" : "0b",
"stored_fields_in_bytes" : 0,
"doc_values" : "0b",
"doc_values_in_bytes" : 0,
"points" : "0b",
"points_in_bytes" : 0,
"norms" : "0b",
"norms_in_bytes" : 0,
"term_vectors" : "0b",
"term_vectors_in_bytes" : 0,
"knn_vectors" : "0b",
"knn_vectors_in_bytes" : 0
},
"fields" : { }
}
}
方法参数
ignore_unavailable,默认值为false。
true,本操作执行时跳过失效或者不可用的index。false,本操作执行时,遇到失效或者不可用的index,则报错,样例如下:{
"error" : {
"root_cause" : [
{
"type" : "index_not_found_exception",
"reason" : "no such index [testindex_002]",
"resource.type" : "index_or_alias",
"resource.id" : "testindex_002",
"index_uuid" : "_na_",
"index" : "testindex_002"
}
],
"type" : "index_not_found_exception",
"reason" : "no such index [testindex_002]",
"resource.type" : "index_or_alias",
"resource.id" : "testindex_002",
"index_uuid" : "_na_",
"index" : "testindex_002"
},
"status" : 404
}
wait_for_active_shards,默认值为1,即主副本。
执行本操作时,必须处于可用状态的副本的数量。
run_expensive_tasks,默认值为false。
计算空间占用率的操作需要消耗大量的资源。
true,执行运算操作。false,提示错误,样例如下:{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "analyzing the disk usage of an index is expensive and resource-intensive, the parameter [run_expensive_tasks] must be set to [true] in order for the task to be performed."
}
],
"type" : "illegal_argument_exception",
"reason" : "analyzing the disk usage of an index is expensive and resource-intensive, the parameter [run_expensive_tasks] must be set to [true] in order for the task to be performed."
},
"status" : 400
}
相关资料
ElasticSearch之Analyze index disk usage API的更多相关文章
- 应用alter index ××× monitoring usage;语句监控索引使用与否
随着时间的累积,在没有很好的规划的情况下,数据库中也许会存在大量长期不被使用的索引,如果快速的定位这些索引以便清理便摆在案头.我们可以使用"alter index ××× monitorin ...
- ElasticSearch查询 第一篇:搜索API
<ElasticSearch查询>目录导航: ElasticSearch查询 第一篇:搜索API ElasticSearch查询 第二篇:文档更新 ElasticSearch查询 第三篇: ...
- Elasticsearch入坑指南之RESTful API
Elasticsearch入坑指南之RESTful API Tags:Elasticsearch ES为开发者提供了非常丰富的基于Http协议的Rest API,通过简单的Rest请求,就可以实现非常 ...
- 10 Useful du (Disk Usage) Commands to Find Disk Usage of Files and Directories
The Linux “du” (Disk Usage) is a standard Unix/Linux command, used to check the information of disk ...
- WinDirStat is a disk usage statistics viewer
WinDirStat is a disk usage statistics viewer and cleanup tool for various versions of Microsoft Wind ...
- elasticsearch使用Analyze API
curl -XGET 'localhost:9200/index_name/_analyze?pretty&field=type_name.field_name' -d 'Robots car ...
- Elasticsearch:Split index API - 把一个大的索引分拆成更多分片
文章转载自:https://blog.csdn.net/UbuntuTouch/article/details/108960950
- 分布式搜索引擎Elasticsearch PHP类封装 使用原生api
//官方的 php api写的鸡肋了,下面这个类可以使用 es api 操作. <?php class ElasticSearch { public $index; function __co ...
- Swiper Usage&&API
最近使用Swipe.js,发现中文的资料很少,试着翻译了一下.能力有限,翻译难免错漏,请指出,多谢!如果想获得国外较多而全的文档,还是用google. 一了解SwiperSwiper 是一款免费以及轻 ...
- Elasticsearch 5.4.3实战--Java API调用:索引mapping创建
因为项目开发使用的是Java语言, 项目的开发架构是Spring MVC+ maven的jar包管理, 所以今天重点说说ES 5.4.3 的Java API的源码实战 1. pom.xml文件增加依 ...
随机推荐
- sqoop1.4.7完全支持Hadoop3.x, Hive3.x Hbase2.x
已经修改好 保存至云盘 自己下载 花了时间的,记得关注我... 链接:https://pan.xunlei.com/s/VNe6P6Tm1A9Q-RG5GByN08rdA1# 提取码:5nke 复制这 ...
- Solution Set -「CF 1539」
我是傻逼. 「CF 1539A」Contest Start Link. 答案是 \(\sum_{i=1}^{n-1}\min\{i,\lfloor\frac{t}{x}\rfloor\}\),等差数列 ...
- 43道Python经典案例题(有答案)
1.有四个数字:1.2.3.4,能组成多少个互不相同且无重复数字的三位数?各是多少? for x in range(0,5): for y in range(0,5): for z in range( ...
- ERROR: nginx-1.22.1 installation failed.
libraries. You can either do not enable the module or install the libraries.make: *** No rule to mak ...
- 【图像处理】如何使用matplotlib 库显示灰度图像为自定义颜色
项目场景 我这里有一张名为airplane.jpg的灰度图像灰度图像 使用 matplotlib 库读取并显示: import matplotlib.pyplot as plt root=" ...
- 文心一言 VS 讯飞星火 VS chatgpt (112)-- 算法导论10.2 3题
三.用go语言,用一个单链表L实现一个队列.要求操作 ENQUEUE 和 DEQUEUE 的运行时间仍为O(1). 文心一言: 在 Go 语言中,使用单链表实现队列的操作,包括入队(ENQUEUE)和 ...
- 【学习】fhq-treap
fhq-treap 是一种好写.复杂度低,且功能的优秀数据结构,涵盖了 treap 几乎所有的功能,其巧妙之处,就在于运用分离和合并两种操作代替了旋转操作. 1. BST 的定义 (摘自 OI Wik ...
- 安装了less后仍然报错:Error: Cannot find module 'less'
结果是命令有点问题,正常来说是用下面的: npm i less –save-dev-g 然后可以正常启动了: --------------------------------------------- ...
- react,es6的括号问题
JavaScript 会自动给行末添加分号.如果 return 后面换行不加括号就会变成 return;. 就是说因为jsx语句跨行了,如果写在一行是可以省略小括号的. const About = ( ...
- MySQL查看数据库性能常用命令和实战教学
MySQL查看数据库性能常用命令 # 列出MySQL服务器运行各种状态值 show global status; # 查询MySQL服务器配置信息语句 show variables; # 慢查询 sh ...