kibana/elasticsearch 6.8-delete_by_query returns reason“blocked by:[forbidden/8/index write(api)];”

nafvub8i  于 2021-06-14  发布在  ElasticSearch
关注(0)|答案(1)|浏览(1194)

我正在使用kibana6.8中的开发工具通过查询删除文档,但是我收到了一个403,类型是“cluster_block_exception”,原因是“blocked by:[forbidden/8/index write(api)];”。
我使用了以下命令:

curl -XPOST "http://localhost:9200/my_index/_delete_by_query" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match_all": {}
  }
}'

下面是一个示例响应:

{
  "took": 26,
  "timed_out": false,
  "total": 2,
  "deleted": 0,
  "batches": 1,
  "version_conflicts": 0,
  "noops": 0,
  "retries": {
    "bulk": 0,
    "search": 0
  },
  "throttled_millis": 0,
  "requests_per_second": -1,
  "throttled_until_millis": 0,
  "failures": [
    {
      "index": "my_index",
      "type": "doc",
      "id": "TnOKCHMBlyetxY-P6HZ_",
      "cause": {
        "type": "cluster_block_exception",
        "reason": "blocked by: [FORBIDDEN/8/index write (api)];"
      },
      "status": 403
    },
    {
      "index": "my_index",
      "type": "doc",
      "id": "T3OKCHMBlyetxY-P6XYF",
      "cause": {
        "type": "cluster_block_exception",
        "reason": "blocked by: [FORBIDDEN/8/index write (api)];"
      },
      "status": 403
    }
  ]
}

任何关于如何设置适当权限的帮助都将不胜感激。谢谢。

v1l68za4

v1l68za41#

您可以尝试首先使用此请求更改索引的状态:

PUT /my_index/_settings { "index": { "blocks": { "write": "false" } } }

第二次,您必须确定导致这种索引状态的原因(索引策略,文件系统:85%的“低水位线”)

相关问题