ElasticSearch报错blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]

这篇具有很好参考价值的文章主要介绍了ElasticSearch报错blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

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

ElasticSearch报错blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]

 发现还是有问题:

[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

磁盘空间不足,清理磁盘,重新运行ES问题解决文章来源地址https://www.toymoban.com/news/detail-510826.html

到了这里,关于ElasticSearch报错blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包