本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的更多相关文章

  1. 应用alter index ××× monitoring usage;语句监控索引使用与否

    随着时间的累积,在没有很好的规划的情况下,数据库中也许会存在大量长期不被使用的索引,如果快速的定位这些索引以便清理便摆在案头.我们可以使用"alter index ××× monitorin ...

  2. ElasticSearch查询 第一篇:搜索API

    <ElasticSearch查询>目录导航: ElasticSearch查询 第一篇:搜索API ElasticSearch查询 第二篇:文档更新 ElasticSearch查询 第三篇: ...

  3. Elasticsearch入坑指南之RESTful API

    Elasticsearch入坑指南之RESTful API Tags:Elasticsearch ES为开发者提供了非常丰富的基于Http协议的Rest API,通过简单的Rest请求,就可以实现非常 ...

  4. 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 ...

  5. WinDirStat is a disk usage statistics viewer

    WinDirStat is a disk usage statistics viewer and cleanup tool for various versions of Microsoft Wind ...

  6. elasticsearch使用Analyze API

    curl -XGET 'localhost:9200/index_name/_analyze?pretty&field=type_name.field_name' -d 'Robots car ...

  7. Elasticsearch:Split index API - 把一个大的索引分拆成更多分片

    文章转载自:https://blog.csdn.net/UbuntuTouch/article/details/108960950

  8. 分布式搜索引擎Elasticsearch PHP类封装 使用原生api

    //官方的 php  api写的鸡肋了,下面这个类可以使用 es api 操作. <?php class ElasticSearch { public $index; function __co ...

  9. Swiper Usage&&API

    最近使用Swipe.js,发现中文的资料很少,试着翻译了一下.能力有限,翻译难免错漏,请指出,多谢!如果想获得国外较多而全的文档,还是用google. 一了解SwiperSwiper 是一款免费以及轻 ...

  10. Elasticsearch 5.4.3实战--Java API调用:索引mapping创建

    因为项目开发使用的是Java语言, 项目的开发架构是Spring MVC+ maven的jar包管理,  所以今天重点说说ES 5.4.3 的Java API的源码实战 1. pom.xml文件增加依 ...

随机推荐

  1. linux上搭建Nacos集群(步骤详细,linux小白也能搞定)

    (1)nacos官网:https://github.com/alibaba/nacos/releases/tag/1.2.1下载nacos安装包到window本地(后缀为tar.zip) (2)在li ...

  2. Solution -「洛谷 P5176」公约数

    Description Link. 求 \[\sum_{i=1}^n\sum_{j=1}^m\sum_{k=1}^p\gcd(i\cdot j,i\cdot k,j\cdot k)\times \gc ...

  3. div 让a内容居中方法

    <div>标签是HTML中的一个重要标签,它代表了一个文档中的一个分割区块或一个部分.在<div>标签中,我们可以放置各种内容,包括文本.图像.链接等等.有时候,我们需要将其中 ...

  4. React框架的基本运行原理与组件定义方式

    React框架的基本运行原理 React的本质是内部维护了一套虚拟DOM树,这个虚拟DOM树就是一棵js对象树,它和真实DOM树是一致的,一一对应的. 当某一个组件的state发生修改时,就会生成一个 ...

  5. PTA乙级1038C++哈希解法

    #include"bits/stdc++.h" using namespace std; int main() { int a,b[105]={0}; long i,n,K; ci ...

  6. python实现汉诺塔的图解递归算法

    写在前面 工作闲来无事,看了python,写了一个汉诺塔. 还是蛮喜欢python这门语言的,很简洁. 正文 一.起源: 汉诺塔(又称河内塔)问题是源于印度一个古老传说的益智玩具.大梵天创造世界的时候 ...

  7. mybatis 操作 mysql 大批量插入,数据分页处理

    /** * 大批量插入,数据分页处理 * * @param tableName 临时表名称 * @param mapHead 临时表属性 Map,key = 临时表字段属性, value = 具体值. ...

  8. [vue]精宏技术部试用期学习笔记 I

    精宏技术部试用期学习笔记(vue) 什么是vue? 我个人对 vue 的理解 是把 html\css\js 三件套融合起来的结构,同时用组件化的思维把一个页面装填起来 同时让页面形成树状结构 优点是方 ...

  9. UML类图(最重要的三个关系)

    关联关系 ============= 关联关系:B是A的属性(A contains B),则A-->B:另外的: 都是特殊的关联关系 AB: 聚合(Aggregation)关系表示整体与部分的关 ...

  10. linux其他命令(查找,软链接,打包和压缩,软件安装)笔记

    1,查找文件 *  是通配符,代表任意字符,0到多个. find 路径  -name  "*.txt"  : 查找在路径下所有以 .txt 结尾的文件. 2,软链接 (1)将桌面目 ...