【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
}

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

相关推荐
axiao94 小时前
2026年呼和浩特集团品牌全域传播服务商推荐:GEO优化+短视频+网站+广告全链路机构
大数据·人工智能
朴实赋能4 小时前
妇儿医院 AI 助手怎么落地?CareWork 本地化智能体的多 Agent 协同与合规边界设计
大数据·人工智能·腾讯云ai代码助手·ai 智能体·医疗多 agent 协同·妇儿医院 ai 助手·本地化部署 ai
Cx330❀4 小时前
【LangChain】LangChain 核心技术全景指南:从基础入门到 LCEL 链式编程
大数据·elasticsearch·搜索引擎·性能优化·langchain·全文检索
字节数据平台7 小时前
iDA:从 ChatBI 到专业数据分析助手的演进之路
大数据·人工智能·机器学习·数据分析
万岳软件开发小城12 小时前
同城O2O系统源码核心架构分析:多商户、订单、支付及运营体系设计
大数据·同城外卖系统源码·同城o2o系统源码·外卖app开发·同城o2o小程序开发·同城o2o软件开发
兴通物联科技12 小时前
SMT PCB 微小 DataMatrix 码扫不动问题分析 兴通 XT8601B 600 万像素工业读码器落地实践
大数据·人工智能·单片机·嵌入式硬件·算法·计算机视觉
进度猫12 小时前
5个甘特图高阶用法,不止简单排工期
大数据·人工智能·产品经理·甘特图·项目管理软件
zww894911114 小时前
AI智能商城APP定制开发实战:从需求到上线完整指南
大数据·人工智能
招财小梗14 小时前
沈阳商贸公司AI企业服务优势几何?
大数据·人工智能·python