Es使用遇到的问题:How to fix ElasticSearch [FORBIDDEN/12/index read-only / allow delete (api)]

If you try to index a document in ElasticSearch and you see an error message like this:

fix-elasticsearch-forbidden-12-index-read-only-allow-delete-api.txt

elasticsearch.exceptions.AuthorizationException: AuthorizationException(403, 'cluster_block_exception', 'blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];')

you can unlock writes to your cluster (all indexes) using

 fix-elasticsearch-forbidden-12-index-read-only-allow-delete-api.sh

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

(thanks to Imran273 on StackOverflow for the original solution)

 

fix-elasticsearch-forbidden-12-index-read-only-allow-delete-api.sh

 

 

posted @ 2022-04-15 10:01  小猫多鱼  阅读(114)  评论(0编辑  收藏  举报
Live2D