All shards failed

前端 未结 3 1571
暗喜
暗喜 2020-12-24 11:20

I was working on elastic search and it was working perfectly. Today I just restarted my remote server (Ubuntu). Now I am searching in my indexes, it is giving me this error.

相关标签:
3条回答
  • 2020-12-24 11:34

    It is possible on your restart some shards were not recovered, causing the cluster to stay red.
    If you hit:
    http://<yourhost>:9200/_cluster/health/?level=shards you can look for red shards.

    I have had issues on restart where shards end up in a non recoverable state. My solution was to simply delete that index completely. That is not an ideal solution for everyone.

    It is also nice to visualize issues like this with a plugin like:
    Elasticsearch Head

    0 讨论(0)
  • 2020-12-24 11:45

    If you're running a single node cluster for some reason, you might simply need to do avoid replicas, like this:

    curl -XPUT -H 'Content-Type: application/json' 'localhost:9200/_settings' -d '
    {
        "index" : {
            "number_of_replicas" : 0
        }
    }'
    

    Doing this you'll force to use es without replicas

    0 讨论(0)
  • 2020-12-24 11:46

    If you encounter this apparent index corruption in a running system, you can work around it by deleting all files called segments.gen. It is advisory only, and Lucene can recover correctly without it.

    From ElasticSearch Blog

    0 讨论(0)
提交回复
热议问题