elasticsearch - 如何撤消将 Elasticsearch Index 设置为只读?

标签 elasticsearch

所以我只是将我的一个索引设置为只读,现在想删除它。

将其设置为只读:

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/

相关文章:

elasticsearch - 如何过滤 elasticsearch 全局聚合?

mongodb - 预定义术语映射

lucene - 在 Elasticsearch 中提升字段前缀匹配

sql-server - 什么是ElasticSearch中良好的Web应用程序SQL Server数据集市实现?

elasticsearch - Elasticsearch模糊查询-最大编辑不能按预期工作

encoding - Elasticsearch将变音符号显示为 “??”

ElasticSearch URI 搜索空字段

elasticsearch - Hibernate-search elasticsearch数据索引是同步的还是异步的

elasticsearch - Elasticsearch 5.x D3集成示例失败

python - 使用 python elasticsearch 时出现连接错误