Elasticsearch read_only_allow_delete自动设置

Per*_*sei 22 elasticsearch

我有Elasticsearch的问题.我试试看

 $ curl -XPUT -H "Content-Type: application/json" \
     http://localhost:9200/_all/_settings \
       -d '{"index.blocks.read_only_allow_delete": false}'
Run Code Online (Sandbox Code Playgroud)

这是我的设置:

"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"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

当我检查设置它看起来很好,但只有几秒钟(3-5)仍然设置为true.我无法添加新元素和查询任何内容,只有_search和delete.有人有什么想法吗?Elasticsearch版本:6.1.1

谢谢

Dee*_*dey 51

弹性搜索自动设置"read_only_allow_delete": "true"磁盘空间不足时.

找到填满存储空间的文件并删除/移动它们.一旦有足够的可用存储空间,请通过Dev Tools(Kibana)运行以下命令.

PUT your_index_name/_settings
{
 "index": {
   "blocks": {
     "read_only_allow_delete": "false"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

(通过终端)

$ curl -XPUT -H "Content-Type: application/json" \
   http://localhost:9200/_all/_settings \
     -d '{"index.blocks.read_only_allow_delete": false}'
Run Code Online (Sandbox Code Playgroud)

正如你的问题所述.

  • 你知道有多少内存会引发这个问题吗? (2认同)

jos*_*eir 5

在尝试为接受的答案中添加少量值(并且因为我将在Google上搜索并以后再返回)的情况下,read_only_allow_delete由于磁盘水印的默认设置基于百分比,因此设置了该标记-这取决于我大磁盘没有多大意义。因此,根据文档说明,我将这些设置更改为“剩余大小” 。

因此,在read_only_allow_delete重新设置为之前false,我首先根据磁盘空间设置水印值:

(使用Kibana UI):

PUT _cluster/settings
{
  "transient": {
    "cluster.routing.allocation.disk.watermark.low": "20gb",
    "cluster.routing.allocation.disk.watermark.high": "15gb",
    "cluster.routing.allocation.disk.watermark.flood_stage": "10gb"
  }
}

PUT your_index_name/_settings
{
 "index": {
   "blocks": {
     "read_only_allow_delete": "false"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

或(通过终端):

$ curl -XPUT -H "Content-Type: application/json" \
   http://localhost:9200/_cluster/_settings \
   -d '{"cluster.routing.allocation.disk.watermark.low": "20gb", 
     "cluster.routing.allocation.disk.watermark.high": "15gb", 
     "cluster.routing.allocation.disk.watermark.flood_stage": "10gb"}'

$ curl -XPUT -H "Content-Type: application/json" \
   http://localhost:9200/_all/_settings \
   -d '{"index.blocks.read_only_allow_delete": false}'
Run Code Online (Sandbox Code Playgroud)