弹性搜索中的文件系统索引的大小 [英] Size of an index on the file system in elasticsearch
问题描述
我有一个非常简单的设置,包括一个在Ubuntu 13.04 64位系统中运行的弹性搜索0.90.2。
I have a very simple setup consisting of one elasticsearch 0.90.2 running in a Ubuntu 13.04 64-bit system.
使用 _status
,这是我的一个索引的信息:
Using _status
, this is the information of one of my indexes:
"edge":{
"index":{
"primary_size":"63.6kb",
"primary_size_in_bytes":65127,
"size":"63.6kb",
"size_in_bytes":65127
},
"translog":{
"operations":0
},
"docs":{
"num_docs":43,
"max_doc":63,
"deleted_docs":20
},
"merges":{
"current":0,
"current_docs":0,
"current_size":"0b",
"current_size_in_bytes":0,
"total":0,
"total_time":"0s",
"total_time_in_millis":0,
"total_docs":0,
"total_size":"0b",
"total_size_in_bytes":0
},
"refresh":{
"total":20,
"total_time":"241ms",
"total_time_in_millis":241
},
"flush":{
"total":20,
"total_time":"47ms",
"total_time_in_millis":47
},
"shards":{
"0":[
{
"routing":{
"state":"STARTED",
"primary":true,
"node":"bn6ndqXtQKGVDg5eWjo78Q",
"relocating_node":null,
"shard":0,
"index":"edge"
},
"state":"STARTED",
"index":{
"size":"9.6kb",
"size_in_bytes":9887
},
"translog":{
"id":1375245630892,
"operations":0
},
"docs":{
"num_docs":8,
"max_doc":12,
"deleted_docs":4
},
"merges":{
"current":0,
"current_docs":0,
"current_size":"0b",
"current_size_in_bytes":0,
"total":0,
"total_time":"0s",
"total_time_in_millis":0,
"total_docs":0,
"total_size":"0b",
"total_size_in_bytes":0
},
"refresh":{
"total":3,
"total_time":"65ms",
"total_time_in_millis":65
},
"flush":{
"total":4,
"total_time":"11ms",
"total_time_in_millis":11
}
}
],
"1":[
{
"routing":{
"state":"STARTED",
"primary":true,
"node":"bn6ndqXtQKGVDg5eWjo78Q",
"relocating_node":null,
"shard":1,
"index":"edge"
},
"state":"STARTED",
"index":{
"size":"9kb",
"size_in_bytes":9284
},
"translog":{
"id":1375245630912,
"operations":0
},
"docs":{
"num_docs":6,
"max_doc":9,
"deleted_docs":3
},
"merges":{
"current":0,
"current_docs":0,
"current_size":"0b",
"current_size_in_bytes":0,
"total":0,
"total_time":"0s",
"total_time_in_millis":0,
"total_docs":0,
"total_size":"0b",
"total_size_in_bytes":0
},
"refresh":{
"total":3,
"total_time":"32ms",
"total_time_in_millis":32
},
"flush":{
"total":4,
"total_time":"7ms",
"total_time_in_millis":7
}
}
],
"2":[
{
"routing":{
"state":"STARTED",
"primary":true,
"node":"bn6ndqXtQKGVDg5eWjo78Q",
"relocating_node":null,
"shard":2,
"index":"edge"
},
"state":"STARTED",
"index":{
"size":"19kb",
"size_in_bytes":19539
},
"translog":{
"id":1375245630990,
"operations":0
},
"docs":{
"num_docs":11,
"max_doc":16,
"deleted_docs":5
},
"merges":{
"current":0,
"current_docs":0,
"current_size":"0b",
"current_size_in_bytes":0,
"total":0,
"total_time":"0s",
"total_time_in_millis":0,
"total_docs":0,
"total_size":"0b",
"total_size_in_bytes":0
},
"refresh":{
"total":6,
"total_time":"74ms",
"total_time_in_millis":74
},
"flush":{
"total":4,
"total_time":"12ms",
"total_time_in_millis":12
}
}
],
"3":[
{
"routing":{
"state":"STARTED",
"primary":true,
"node":"bn6ndqXtQKGVDg5eWjo78Q",
"relocating_node":null,
"shard":3,
"index":"edge"
},
"state":"STARTED",
"index":{
"size":"15.6kb",
"size_in_bytes":16049
},
"translog":{
"id":1375245631046,
"operations":0
},
"docs":{
"num_docs":9,
"max_doc":13,
"deleted_docs":4
},
"merges":{
"current":0,
"current_docs":0,
"current_size":"0b",
"current_size_in_bytes":0,
"total":0,
"total_time":"0s",
"total_time_in_millis":0,
"total_docs":0,
"total_size":"0b",
"total_size_in_bytes":0
},
"refresh":{
"total":5,
"total_time":"43ms",
"total_time_in_millis":43
},
"flush":{
"total":4,
"total_time":"10ms",
"total_time_in_millis":10
}
}
],
"4":[
{
"routing":{
"state":"STARTED",
"primary":true,
"node":"bn6ndqXtQKGVDg5eWjo78Q",
"relocating_node":null,
"shard":4,
"index":"edge"
},
"state":"STARTED",
"index":{
"size":"10.1kb",
"size_in_bytes":10368
},
"translog":{
"id":1375245631130,
"operations":0
},
"docs":{
"num_docs":9,
"max_doc":13,
"deleted_docs":4
},
"merges":{
"current":0,
"current_docs":0,
"current_size":"0b",
"current_size_in_bytes":0,
"total":0,
"total_time":"0s",
"total_time_in_millis":0,
"total_docs":0,
"total_size":"0b",
"total_size_in_bytes":0
},
"refresh":{
"total":3,
"total_time":"27ms",
"total_time_in_millis":27
},
"flush":{
"total":4,
"total_time":"7ms",
"total_time_in_millis":7
}
}
]
}
}
索引的总大小应为 63.6kb
从响应。
The total size of the index should be 63.6kb
from the response.
但是,如果我检查 / var / lib / elasticsearch / elasticsearch / nodes / 0 / indices / edge
鹦鹉螺,大小报告为 153.1kb
。
However, if I check /var/lib/elasticsearch/elasticsearch/nodes/0/indices/edge
using nautilus, the size is reported as 153.1kb
.
为什么会有这么大的区别?弹性搜索如何计算大小?
Why is there such a big difference? How does elasticsearch calculate the size?
推荐答案
有两个不是中的索引文件的文件$ {data} / nodes / 0 / indices / edge
,如群集状态和事务日志。您应该可以通过运行 wc -c / var / lib / elasticsearch / elasticsearch / nodes / 0 / indexes / edge / * / index / * $ c获得与弹性搜索报告相同的号码$ c>。
There are a couple of files which are not index files in ${data}/nodes/0/indices/edge
, such as cluster state and the transaction log. You should be able to get the same number as reported by Elasticsearch by running wc -c /var/lib/elasticsearch/elasticsearch/nodes/0/indices/edge/*/index/*
.
这篇关于弹性搜索中的文件系统索引的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!