ES报错:“type“=>“cluster_block_exception“, “reason“=>“blocked by: [FORBIDDEN/12/index read-only / allow

简介: ES报错:“type“=>“cluster_block_exception“, “reason“=>“blocked by: [FORBIDDEN/12/index read-only / allow

问题描述:


es中数据一直没有更新进来,第一步想到的是看看logstash是否将数据打到了es中,就发现了这个报错:

{"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}


而且整个日志文件一直在刷,从错误的字面意思看就是,啥结点,只让读了。开始怀疑是不是es出了问题。但是对于es又不是太熟,就网上巴拉巴拉搜了一下,大家给出的意见都差不多,就是es所占磁盘容量达到阈值了,就会启动自我保护机制。禁止所有索引数据的写入,就只让读了,就会出这个问题。


问题解决方法一:


在kibana中执行以下命令,解除所有索引的锁定状态,就会ok了。

# 解除所有索引的只读锁定
PUT /_all/_settings
{"index.blocks.read_only_allow_delete": null}
# 使用通配符批量解除锁定
PUT /auth-server-prd*/_settings?pretty
{
  "index.blocks.read_only_allow_delete": null
}

e24326091b014dbfbbc96a1f7f75a795.png

问题解决方法二:


若是想根本解决这个问题,那么就是调整这个自我保护的阈值默认是85(这个默认值其实挺好不建议改),这个需要更改es的配置文件了。

cd /apps/elasticsearch-6.3.2/config/
vim elasticsearch.yml
# 更改如下配置,没有的话就新增该配置,不过不建议改
cluster.routing.allocation.disk.watermark.flood_stage: 99%
# 若是不更改这个值,也可以在末尾加另一个配置,与上面二选一即可
cluster.routing.allocation.disk.threshold_enabled: false


总结


问题排查很是快,解决也很快。再次记录加深印象,方便后面查找,感谢以下文字提供的解决思路:

https://blog.csdn.net/Darling_for/article/details/104021263
https://blog.csdn.net/weixin_42557481/article/details/103686467
相关文章
|
27天前
|
编解码 数据处理
|
7天前
|
索引
Elasticsearch exception [type=illegal_argument_exception, reason=index [.1] is the write index for data stream [slowlog] and cannot be deleted]
在 Elasticsearch 中,你尝试删除的索引是一个数据流(data stream)的一部分,而且是数据流的写入索引(write index),因此无法直接删除它。为了解决这个问题,你可以按照以下步骤进行操作:
|
20天前
|
存储
tracker_query_storage fail, error no: 28, error info: No space left on device
tracker_query_storage fail, error no: 28, error info: No space left on device
11 0
|
4月前
|
存储
Build desc failed:Fetch table group shards failed on meta proxy:Loading cached shard 1ocation value for table group[dwhg_scm.dwhg_prd_tg_default] failed
Build desc failed:Fetch table group shards failed on meta proxy:Loading cached shard 1ocation value for table group[dwhg_scm.dwhg_prd_tg_default] failed
40 2
|
4月前
报错modify sync object Modify sync object Failed!
报错modify sync object Modify sync object Failed!
21 1
|
8月前
|
前端开发 数据库
Failed to load response dataNo data found for resource with given identifier
Failed to load response dataNo data found for resource with given identifier
1049 0
|
8月前
|
数据安全/隐私保护
Do Sync Disk 0 Part 0 Failed, code=S3_F42, msg=Sync Failed after retry 5 times
Do Sync Disk 0 Part 0 Failed, code=S3_F42, msg=Sync Failed after retry 5 times
144 1
|
Java Go
ES 查询时提示:all shards failed [type=search_phase_execution_exception]
ES 查询时提示:all shards failed [type=search_phase_execution_exception]
ES 查询时提示:all shards failed [type=search_phase_execution_exception]
Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]
Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]
Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]

热门文章

最新文章