es: unassigned no_valid_shard_copy

某天
通过elasticsearch-head发现线上的elasticsearch有个index的分片有问题,查看详情:

{
    "state": "UNASSIGNED",
    "primary": true,
    "node": null,
    "relocating_node": null,
    "shard": 1,
    "index": "xxxlog-2020-06-18",
    "recovery_source": {
	    "type": "EXISTING_STORE",
	    "bootstrap_new_history_uuid": false
	},
    "unassigned_info": {
        "reason": "NODE_LEFT",
        "at": "2020-06-21T04:03:19.276Z",
        "delayed": false,
        "details": "node_left [OFsaH204RTOMyujSJohmaQ]",
        "allocation_status": "no_valid_shard_copy"
    }
}

不明所以

经过探索,使用下面的方法解决了(在kibana-console)中执行:

POST /_cluster/reroute
{
  "commands": [
    {
      "allocate_empty_primary": {
        "index": "xxxlog-2020-06-18",
        "shard": 1,
        "node": "elk-log-es-data-2",
        "accept_data_loss": true
      }
    }
  ]
}

欢迎补充指正
(完)

相关链接

  • https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html
  • https://blog.csdn.net/coderluo/article/details/78209161

你可能感兴趣的:(ELK)