When you delete a doc, it does not get actually deleted until the relevant internal lucene segment (a subset of the actual lucene index) that includes deletes gets merged "out". If you want to completely optimize an index, you can optimize it down into a single segment, or run the the optimize request with only_expunge_deletes set to true. Note, this will be an intensive IO operation.
4 个回复
stab - freshman
赞同来自: huangzhiwei
helloes
赞同来自:
具体一篇文档被存储到哪个分片上,是由下面这个公式决定的:
routing默认值为_id,也可以自定义
alexzhang - 饿了么
赞同来自:
我这边是两台机器,默认的是5个shard在一个机器上,2个replica,
理论上 应该两台机器磁盘用量一致
alexzhang - 饿了么
赞同来自:
https://discuss.elastic.co/t/w ... /4000
When you delete a doc, it does not get actually deleted until the relevant internal lucene segment (a subset of the actual lucene index) that includes deletes gets merged "out". If you want to completely optimize an index, you can optimize it down into a single segment, or run the the optimize request with only_expunge_deletes set to true. Note, this will be an intensive IO operation.
可以通过如下命令整理空间
curl -XPOST 'http://10.0.11.109:9200/_optimize?only_expunge_deletes=true'