org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=cluster_block_exception, reason=blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)
at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2053)
at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2030)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1777)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1734)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1696)
at org.elasticsearch.client.RestHighLevelClient.update(RestHighLevelClient.java:998)
Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://127.0.0.1:9200], URI [/ks_crm_leads/_doc/8/_update?doc_as_upsert=true&timeout=1m], status line [HTTP/1.1 403 Forbidden]
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403}
at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:936)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:233)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1764)
... 122 common frames omitted
Caused by: org.elasticsearch.client.ResponseException: method [POST], host [http://127.0.0.1:9200], URI [/ks_crm_leads/_doc/8/_update?doc_as_upsert=true&timeout=1m], status line [HTTP/1.1 403 Forbidden]
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403}
at org.elasticsearch.client.RestClient$1.completed(RestClient.java:552)
at org.elasticsearch.client.RestClient$1.completed(RestClient.java:537)
at org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:122)
at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:181)
根据错误信息,是索引只有只读和删除权限,解决方法:
curl -XPUT -H ‘Content-Type: application/json’ http://127.0.0.1:9200/_all/_settings -d ’
{
"index": {
"blocks": {
"read_only_allow_delete": "false"
}
}
}’
或者用PostMan
注意要设置头信息 Content-Type: application/json
发现还是有问题:
[2022-09-09T18:11:46,807][WARN ][o.e.c.r.a.DiskThresholdMonitor] [7bF6q4C] flood stage disk watermark [95%] exceeded on [7bF6q4CdQvmTvsGIFEVJPg][7bF6q4C][G:\soft\elasticsearch-6.8.6\data\nodes\0] free: 4.6gb[3.5%], all indices on this node will be marked read-only文章来源:https://www.toymoban.com/news/detail-510826.html
磁盘空间不足,清理磁盘,重新运行ES问题解决文章来源地址https://www.toymoban.com/news/detail-510826.html
到了这里,关于ElasticSearch报错blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!