Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
82 views
in Technique[技术] by (71.8m points)

Elasticsearch read_only_allow_delete auto setting

I have problem with Elasticsearch. I tried the following:

 $ curl -XPUT -H "Content-Type: application/json" 
     http://localhost:9200/_all/_settings 
       -d '{"index.blocks.read_only_allow_delete": false}'

My settings:

"settings": {
  "index": {
    "number_of_shards": "5",
    "blocks": {
      "read_only_allow_delete": "true"
    },
    "provided_name": "new-index",
    "creation_date": "1515433832692",
    "analysis": {
      "filter": {
        "ngram_filter": {
          "type": "ngram",
          "min_gram": "2",
          "max_gram": "4"
        }
      },
      "analyzer": {
        "ngram_analyzer": {
          "filter": [
            "ngram_filter"
          ],
          "type": "custom",
          "tokenizer": "standard"
        }
      }
    },
    "number_of_replicas": "1",
    "uuid": "OSG7CNAWR9-G3QC75K4oQQ",
    "version": {
      "created": "6010199"
    }
  }
}

When I check settings it looks fine, but only a few seconds (3-5) and it's still set to true. I can't add new elements and query anything, only _search and delete.

Someone have any idea how to resolve this?

NOTE: I'm using Elasticsearch version: 6.1.1

question from:https://stackoverflow.com/questions/48155774/elasticsearch-read-only-allow-delete-auto-setting

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Elasticsearch automatically sets "read_only_allow_delete": "true" when hard disk space is low.

Find the files which are filling up your storage and delete/move them. Once you have sufficient storage available run the following command through the Dev Tool in Kibana:

PUT your_index_name/_settings
{
 "index": {
   "blocks": {
     "read_only_allow_delete": "false"
    }
  }
}

OR (through the terminal):

$ curl -XPUT -H "Content-Type: application/json" 
   http://localhost:9200/_all/_settings 
     -d '{"index.blocks.read_only_allow_delete": false}'

as mentioned in your question.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...