好的想法是十分钱一打,真正无价的是能够实现这些想法的人。

ES 5.5.0 产生很多未分配的分片,如何解决?

Elasticsearch | 作者 zhuzjES | 发布于2018年09月19日 | 阅读数:5985

GET /_cluster/allocation/explain?pretty  如下:

{ "index" : "home_page_dynamic_index", "shard" : 3, "primary" : false, "current_state" : "unassigned", "unassigned_info" : { "reason" : "CLUSTER_RECOVERED", "at" : "2018-09-19T04:48:52.410Z", "last_allocation_status" : "no_attempt" }, "can_allocate" : "no", "allocate_explanation" : "cannot allocate because allocation is not permitted to any of the nodes", "node_allocation_decisions" : [ { "node_id" : "Wl9szqEpR2-BsmQhNduIqA", "node_name" : "swhy-node-01", "transport_address" : "172.17.0.1:9300", "node_decision" : "no", "deciders" : [ { "decider" : "same_shard", "decision" : "NO", "explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[home_page_dynamic_index][3], node[Wl9szqEpR2-BsmQhNduIqA], [P], s[STARTED], a[id=pWNm54C6SoOTTsXXvX6PuA]]" } ] } ] }

a.png

128机器:

128_config.png


128_config_2.png


128.png

 
131机器

131_config.png


131_config_2.png


131.png
已邀请:

zqc0512 - andy zhou

赞同来自:

the shard cannot be allocated to the same node on which a copy of the shard already exists
这是原因……你有节点挂了?还是自己玩的环境?

qw8613243

赞同来自:

按道理不会出现这种情况 尝试集群全部关闭,然后优先启动主节点。如果还不行,就找出未分配的分片 手动移动到其他节点上,网上有操作例子

juin - 大数据开发

赞同来自:

应该是有个节点挂掉了,查下监控

rojay - 杭州的一枚90后初入职场的IT男

赞同来自:

看了下,未分配的shard都是副本,你这个环境是单机吧?如果是单机的话,相同shard不允许同时分配到一个节点上。当前ES的状态应该是yellow的,但是不影响使用!

yayg2008

赞同来自:

副本数改成0就可以了。--同一个分片的主副分片默认不能在一个节点上,所以不能分配的全部是r 副本分片

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

zqc0512 - andy zhou

赞同来自:

我看了下你的配置。
discovery.zen.ping.unicast.hosts:
应该是这玩意错误了。把所有节点都添加进行,不要用9300,只要IP地址。
discovery.zen.ping.unicast.hosts: ["xxxx", "xxxx"]

要回复问题请先登录注册