【cluster_block_exception】写操作elasticsearch索引报错

【cluster_block_exception】操作elasticsearch索引b报错

背景

今天线上elk的数据太多,服务器的空间不足了。所以打算删除一些没用用的数据。我是用下面的request:

复制代码
POST /{index_name}/_delete_by_query?wait_for_completion=false
{
  "query": {
    "bool": {
      "must": {
        "match": {
          "loglevel": "DEBUG"
        }
      }
    }
  }
}

但是出错了。

{ _index: '',

_type: 'type',

_id: 'record id',

status: 403,

error:

{ type: 'cluster_block_exception',

reason: 'blocked by: FORBIDDEN/8/index write (api);' } }

导致原因:

(都是比较简单的英文,我就直接粘贴过来了):
相关帖子

from reaching red or yellow status. It does this using index.blocks.write.

The two reasons being:

Low Memory

When the JVMMemoryPressure metric exceeds 92% for 30 minutes, Amazon ES triggers a protection mechanism and blocks all write operations to prevent the cluster from reaching red status. When the protection is on, write operations fail with a ClusterBlockException error, new indexes can't be created, and the IndexCreateBlockException error is thrown.

When the JVMMemoryPressure metric returns to 88% or lower for five minutes, the protection is disabled, and write operations to the cluster are unblocked.

Low Disk Space

Elasticsearch has a default "low watermark" of 85%, meaning that once disk usage exceeds 85%, Elasticsearch no longer allocates shards to that node. Elasticsearch also has a default "high watermark" of 90%, at which point it attempts to relocate shards to other nodes.

官网对index.blocks.write参数的描述:

https://www.elastic.co/guide/en/elasticsearch/reference/6.0/index-modules.html#dynamic-index-settings

解决方法:

https://sease.io/2022/06/elasticsearch-disk-space-issue-and-rollover-solution.html

disale index.blocks.write.

复制代码
PUT /[_all|<your_index_name>]/_settings
{
  "index.blocks.write": null
}

然后再重试之前的删除请求。

相关推荐
有Li6 分钟前
基于超高分辨率CT智能分割与测量的单侧梅尼埃病内耳解剖特征定量研究文献速递/医学智能体前沿
大数据·人工智能·学习·文献·医学生
微三云 - 廖会灵 (私域系统开发)9 分钟前
软件定制开发的 7 个交付节点:每个阶段该产出什么、怎么验收
大数据·系统架构
龙亘川11 分钟前
城市公共安全治理如何从“人海战术“走向“数据驱动“?
大数据·数据库·人工智能·安全·microsoft·智慧城市·数据可视化
安教安全员通关宝42 分钟前
2026年上海建筑安全员B证考试题库+答案+解析
大数据
志栋智能1 小时前
微成本大收益:超自动化巡检的ROI优化之道
大数据·人工智能
Geek-Chow1 小时前
Building and Using a Jenkins Shared Library
jenkins
T06205141 小时前
【数据集】各地级市污水处理厂详细指标数据(1985-2024年)
大数据
跨境联盟1 小时前
实体大健康门店转型:精准营养服务如何跳出单纯卖产品的困局
大数据·人工智能·健康医疗·健康管理·精准营养
appsvip1 小时前
给社区系统加一套 AI 助手:从架构到落地的思考
大数据·人工智能·架构
文慧的科技江湖2 小时前
2026年10月21日充电桩行业招投标早报:平台第一次进了标的名字,还是没进报价表
大数据·人工智能·开源·新能源·充电桩·新能源汽车·招投标