提问要多花一点心思哦

es集群新增节点不分配shard

匿名 | 发布于2019年06月05日 | 阅读数:5829

集群原有2台,  按天生产索引, 索引分片数为5, 副本为0,      新加一台节点, 成功加入集群, 但没有分配shard。
新节点加入集群后shard不会重新平衡吗?
 
如图:  node-2为新增的节点
a.png

 
设置了下面2个参数不起作用(其实默认都是这个值)
"cluster.routing.allocation.enable": "all"
"cluster.routing.rebalance.enable": "all"
 
如何使分片重新分配均匀?   新增的索引也不能分配到node-2上
已邀请:

apeletMarshal - 小猿帅

赞同来自: newairisme

1. 首先确定当前节点是什么角色?是不是数据节点
  GET    /_cat/nodes?h=name,node.role
2.  集群级别的设置
  GET    /_cluster/settings?include_defaults=true
3. 索引级别的设置
 GET    indexName/_settings?include_defaults=true

bellengao - 博客: https://www.jianshu.com/u/e0088e3e2127

赞同来自:

两种方式:
(1)配置index.routing.allocation.total_shards_per_node https://www.elastic.co/guide/e ... .html
(2) 修改cluster.routing.allocation.balance.index以及cluster.routing.allocation.balance.shard, 前者设置为1.0,后者设置为0的情况下可以使得每个索引的分片都在节点上均衡,https://www.elastic.co/guide/e ... .html

printf_uck - 1024

赞同来自:

你是不是索引设置了 drive,扩容的节点没有这个属性,所以不会自动分配过去

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

赞同来自:

我实践过的方法:关闭索引,然后open 打开索引。索引分片会自动分配。
匿名用户

匿名用户

赞同来自:

谢谢各位回复, 按照 apeletMarshal 的方法, 看到node-2被exclude了,  之前设了exclude, 以为再次设置include就可以了, 然而并不是, 需要将exclude清除,  清除后就自动重新分配shard了

要回复问题请先登录注册