码迷,mamicode.com
首页 > 其他好文 > 详细

ELK出现unassigned_shards解决办法

时间:2018-07-23 11:09:00      阅读:571      评论:0      收藏:0      [点我收藏+]

标签:route   init   search   number   comm   pos   ima   status   sha   

1)查看健康状态信息

curl -XGET http://172.20.9.76:9200/_cluster/health\?pretty 
{
  "cluster_name" : "elasticsearch_MYBOOKING",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 2,
  "number_of_data_nodes" : 2,
  "active_primary_shards" : 85,
  "active_shards" : 85,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 2
}

2)找到未分片的索引

curl -s "http://172.20.9.76:9200/_cat/shards" | grep UNASSIGNED

3)执行reroute 

curl -XPOST '172.20.9.76:9200/_cluster/reroute' -d '{
"commands" : [ {
"allocate" : {
"index" : "logstash-2018.07.20",
"shard" : 3,
"node" : "_0WmGRqVQ4WlQuEncqvOBw",
"allow_primary" : true
}   
}

4)实在不行就删除该索引

curl -XDELETE  http://172.20.9.76:9200/logstash-2018.07.20


ELK出现unassigned_shards解决办法

标签:route   init   search   number   comm   pos   ima   status   sha   

原文地址:http://blog.51cto.com/lzhnb/2148851

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!