所以我只是将我的一个索引设置为只读,现在想删除它。
将其设置为只读:
PUT my_index/_settings
{ "index": { "index.blocks.read_only" : true } }
当我试图删除它时,我得到了这样的回复:
ClusterBlockException[blocked by: [FORBIDDEN/5/index read-only (api)];]
然后我尝试将索引设置为 readonly false:
PUT my_index/_settings
{ "index": { "index.blocks.read_only" : false } }
但这给出了与上面相同的错误消息。那么如何将readonly设置回false呢?
最佳答案
答案真的很旧所以我也会添加一个 elastic-6+ 答案:
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
仅供引用(上下文):由于磁盘用完,我遇到了只读索引,并从 logstash 收到错误消息:
...retrying failed action with response code: 403 ({"type"=>"cluster_block_exception", "reason"=>"blocked"
Elasticsearch :
ClusterBlockException[阻止者:[FORBIDDEN/12/index 只读/允许删除
(api)];]
关于elasticsearch - 如何撤消将 Elasticsearch Index 设置为只读?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34911181/