elasticsearch - 有什么方法可以知道索引字段在 Elasticsearch 中占用多少磁盘空间
问题描述
我正在索引一个定义了映射字段的文档,磁盘大小最终太大,我想检查每个索引字段占用多少磁盘空间?
有什么办法吗?此处的索引统计信息似乎仅显示所有字段的整体(https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html)
- 索引字段映射
{
'_source': {
'enabled': False,
},
'properties': {
'ip': {
'type': 'ip',
},
'timestamp': {
'type': 'date',
},
'data': {
'type': 'text',
},
...
}
}
更新索引统计信息
curl -X GET "localhost:9200/_cat/allocation?v"
shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
3 6.3mb 28.3gb 30gb 58.4gb 48 172.17.0.3 172.17.0.3 57dac878cf46
2 UNASSIGNED
curl -X GET "localhost:9200/_cat/indices?v"
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open my-index vjdK1nkRRimxtdUvgKWNHA 1 1 10000 0 6.3mb 6.3mb
yellow open .kibana kDM_5IpMQfacYN6F2_mxrQ 1 1 1 0 5kb 5kb
解决方案
给定字段的值可能不会只在一个地方存储一次,Lucene 中有许多不同的底层数据结构。
您可以在回答相同问题的此线程中找到更多信息:https ://lucene.472066.n3.nabble.com/Get-size-occupied-by-each-field-in-lucene-index-td4347856.html
推荐阅读
- postgresql - 多态关联的情况如何处理
- c++ - uwebsockets 编译错误 Visual Studio 2019
- google-chrome-extension - 使用 Chrome 扩展程序控制第三方网站上的 youtube 视频播放器
- python - Python中的旋转滑块失败
- python - 将 VS Code Jupyter Notebook 中的输出折叠到可滚动窗口中
- git - 在源云存储库之间传输时如何排除某些文件?
- c++ - 在 C++ 中的非模板结构内使用模板节点结构指针
- ios - 使用自动调整集合视图单元格大小时的 AutoLayout 警告
- google-tag-manager - 如何将 GTM 中的图像 URL 刮到变量中?
- google-bigquery - 为第三方模块创建的动态资源指定depends_on