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

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

相关推荐
Promise微笑7 小时前
2026年国产替代油介损测试仪:油介损全场景解决方案与技术演进
大数据·网络·人工智能
workflower7 小时前
具身智能行业应用-生活服务业
大数据·人工智能·机器人·动态规划·生活
志栋智能8 小时前
超自动化安全:构建智能安全运营的核心引擎
大数据·运维·服务器·数据库·安全·自动化·产品运营
xiaoduo AI8 小时前
客服机器人非工作时间能休眠?智能Agent开放平台定时唤醒,无人值守省资源?
大数据·人工智能·机器人
好赞科技9 小时前
深度测评2026年精选美发预约小程序排行榜 革新预约新体验 修订
大数据·微信小程序
集和诚JHCTECH11 小时前
BRAV-7120加持,让有毒有害气体无处遁形
大数据·人工智能·嵌入式硬件
互联网志12 小时前
加速高校科技成果转化 赋能实体经济高质量发展
大数据·人工智能·物联网
李可以量化12 小时前
DeepSeek 量化交易实战:用标准化提示词模板实现 AI 辅助交易决策
大数据·数据库·人工智能
学掌门13 小时前
数据分析师职业规划——数据分析师的职业焦虑与未来发展
大数据·信息可视化
亚马逊云开发者13 小时前
EMR Core 节点部署 Flink Client 实战:Bootstrap Action 一次打包多次复用,解决调度系统提交任务的痛点
大数据·flink·bootstrap