亲,只收二进制

es出现replica shard unassign

Elasticsearch | 作者 shjdwxy | 发布于2018年02月27日 | 阅读数:4363

基于es做日志的存储,对于历史index(没有新数据写入)会做replica数量调整,副本数从0调整为1。但是经常会发现部分index,replica shard不能assign。
调用 /_cluster/allocation/explain 接口,发现unassign状态的shard都是可以被分配的。
例如:
{
"index": "billions-bplus-alarm-dynamic-biz-sketch-dao-@2018.02.24",
"shard": 8,
"primary": false,
"current_state": "unassigned",
"unassigned_info": {
"reason": "REPLICA_ADDED",
"at": "2018-02-26T17:30:04.428Z",
"last_allocation_status": "no_attempt"
},
"can_allocate": "yes",
"allocate_explanation": "can allocate the shard",
"target_node": {
"id": "Bp7Dya1_TDG6e79NkR99fQ",
"name": "hzxs-billions-es-03-datanode_stale",
"transport_address": "172.19.20.221:9301",
"attributes": {
"box_type": "stale"
}
},
"node_allocation_decisions": [
{
"node_id": "DGiC5DK1SMK4cqew3iWvpA",
"node_name": "hzxs-billions-es-18-datanode_stale",
"transport_address": "172.19.20.236:9301",
"node_attributes": {
"box_type": "stale"
},
"node_decision": "yes",
"weight_ranking": 23
},
{
"node_id": "LLVHrovaRiek8A4cYqtjfQ",
"node_name": "hzxs-billions-es-19-datanode_stale",
"transport_address": "172.19.20.237:9301",
"node_attributes": {
"box_type": "stale"
},
"node_decision": "yes",
"weight_ranking": 24
},
{
"node_id": "Bp7Dya1_TDG6e79NkR99fQ",
"node_name": "hzxs-billions-es-03-datanode_stale",
"transport_address": "172.19.20.221:9301",
"node_attributes": {
"box_type": "stale"
},
"node_decision": "yes",
"weight_ranking": 25
},
这个unassign状态一直持续,不能恢复。 es的版本是5.4.3, 大家有遇到过类似的问题吗?
已邀请:

illbehere - 80后it男

赞同来自:

你可以强制恢复
curl -XPOST "http://ip:9200/_cluster/reroute" -d '{ "commands" : [ { "allocate_replica" : { "index" : "index", "shard" : 4, "node" : "node11" } } ] }'

 
http://www.fanjunyue.com/index ... jing/
 

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

赞同来自:

要回复问题请先登录注册