试试搜索一下吧

ES 两节点集群,数据不一致

Elasticsearch | 作者 alexzhang | 发布于2016年03月15日 | 阅读数:8277


kopf_napos-es_.jpg

前几天开始node-2 数据往上涨,node-1一致没动过,这是一个最简单的双节点ES,理论上数据应该是一致的,请教各位,有没有碰到类似的情况。
已邀请:

stab - freshman

赞同来自: huangzhiwei

多虑了吧,你机子上应该不是只放了ES的数据吧.它统计的应该是总共的占用量,而不是单单ES的占用量

helloes

赞同来自:

可以再说多一点信息吗?
 
具体一篇文档被存储到哪个分片上,是由下面这个公式决定的:
shard = hash(routing) % number_of_primary_shards
routing默认值为_id,也可以自定义

alexzhang - 饿了么

赞同来自:

@helloes 
 
我这边是两台机器,默认的是5个shard在一个机器上,2个replica,
 

kopf_napos-es_.jpg

 
 
理论上 应该两台机器磁盘用量一致

alexzhang - 饿了么

赞同来自:

https://www.elastic.co/guide/e ... index 

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'

要回复问题请先登录注册