在这种情况下,系统每天都会在节点内生成索引。每个索引都有1个主要分片。
因此,一天中建立索引的所有文档都将移至某个索引,并且经过一天之后,将创建一个新索引。
我保留最近60天的索引(因此这意味着我节点中始终有60个分片)。我无法关闭旧索引,因为我希望它们支持搜索。经过60天后,我将其删除。
当我阅读以下article时,我注意到有关索引缓冲区的内容:
It defaults to 10%, meaning that 10% of the total memory allocated to a node will be used as the indexing buffer size. This amount is then divided between all the different shards
这意味着对于当天的索引,我有10%/ 60的缓冲索引内存。所以我并没有真正使用10%。
问题是,如果我set to read only the older indices:会发生什么?
index.blocks.read_only Set to true to make the index and index metadata read only, false to allow writes and metadata changes.
我会看到这样做的好处吗?就像在我唯一的可写索引中拥有整个索引缓冲区的10%一样?还是其他索引的搜索有所改进,因为它们不再接收写入就可以合并为一个单独的分段?
谢谢!
巴勃罗
PD:我正在使用ElasticSearch 1.7.3,但是我希望将来能够迁移到2.2。如果可能的话,我想知道是否可以将其转换为2.2
最佳答案
不,添加read_only块不会带来任何好处。释放缓冲区的唯一方法是完全关闭索引。
另外,您可能想知道https://github.com/elastic/elasticsearch/pull/14121,它为“主动索引”分片提供了更大份额的缓冲区。即将在Elasticsearch 5.0中提供。
关于performance - ElasticSearch-将索引设置为只读可提高性能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35562925/