设置参数 `node.name` 可以自定义 Elasticsearch 节点的名字。 此条 Tips 由 medcl 贡献。

es升级后分片不分配

Elasticsearch | 作者 shitangjiejie | 发布于2018年05月18日 | 阅读数:7038

按照官网说的平滑升级,从5.3版本升级到5.4版本,升级之前禁用分片分配
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "none"
}
}
升级好后打开了分片分配
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "all"
}
}
但是今天早上过来一看 发现今天的分片都没分配
请各位大佬帮忙解答下这是什么情况,我是参考着这篇文档来做的:
https://www.elastic.co/guide/e ... .html
微信图片_20180518090351.png
已邀请:

rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk

赞同来自:

你 GET 这个 setting 设置是正确的吗?es日志里面有没有什么有用的信息?
 
你重新关闭和打开 这个 allocation 的设置看下,是否就开始分配

yayg2008

赞同来自:

你的新旧版本data目录是否有变动?

kennywu76 - Wood

赞同来自:

如果确认集群的allocation已经打开,可以用
GET /_cluster/allocation/explain
得到分片无法分配的原因,然后据此排查问题。

shitangjiejie

赞同来自:

运行GET /_cluster/allocation/explain  发现有个节点没打开分配  到那台机器上运行打开分配
[root@scdata02 fabuxitong]# curl -XPUT http://10.10.17.202:9001/_cluster/settings -d '{ "persistent": { "cluster.routing.allocation.enable": "all" } }'
{"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"all"}}}},"transient":{}}
再来运行GET /_cluster/allocation/explain,发现还是同样报错
{
"index": "ccl-2016.05.24",
"shard": 4,
"primary": true,
"current_state": "unassigned",
"unassigned_info": {
"reason": "INDEX_CREATED",
"at": "2018-05-17T10:28:15.193Z",
"last_allocation_status": "no"
},
"can_allocate": "no",
"allocate_explanation": "cannot allocate because allocation is not permitted to any of the nodes",
"node_allocation_decisions": [
{
"node_id": "lvNcRHMXTaGXhY_-2jTsNQ",
"node_name": "node-2",
"transport_address": "10.10.17.202:9300",
"node_decision": "no",
"weight_ranking": 1,
"deciders": [
{
"decider": "enable",
"decision": "NO",
"explanation": "no allocations are allowed due to {}"
}
]
},
{
"node_id": "QLMQqhAhRBGuTZJm6FXc5Q",
"node_name": "node-1",
"transport_address": "10.10.17.201:9300",
"node_decision": "no",
"weight_ranking": 2,
"deciders": [
{
"decider": "enable",
"decision": "NO",
"explanation": "no allocations are allowed due to {}"
}
]
}
]
}

kennywu76 - Wood

赞同来自:

GET /_cluster/settings 看一下集群的设置。 另外查一下master结点的日志,看看有报什么异常。

夏李俊

赞同来自:

建议试试
curl -XPUT -d {"index.routing":"null"}

要回复问题请先登录注册