So I just set one of my indices to readonly, and now want to delete it.
To set it to readonly:
PUT my_index/_settings { "index": { "index.blocks.read_only" : true } } When I tried to delete it I got this response:
ClusterBlockException[blocked by: [FORBIDDEN/5/index read-only (api)];] Then I tried to set the index to readonly false:
PUT my_index/_settings { "index": { "index.blocks.read_only" : false } } But that gives the same error message as above. So how to set readonly back to false?
Answers are really old so I'll add a elastic-6+ answer too:
PUT /[_all|<index-name>]/_settings { "index.blocks.read_only_allow_delete": null } https://www.elastic.co/guide/en/elasticsearch/reference/6.x/disk-allocator.html
FYI (for context): I ran into read-only indices due to running out of disk and got error messages from logstash:
...retrying failed action with response code: 403 ({"type"=>"cluster_block_exception", "reason"=>"blocked" elasticsearch:ClusterBlockException[blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With