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

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

相关推荐
GlobalInfo40 分钟前
AI与另类数据融合,市场研究正在从“经验驱动”走向“数据智能”
大数据·网络·人工智能·ai
新点一讯1 小时前
聚焦流程数智升级,九科信息企业自动化智能体赋能高效运营
大数据·人工智能
美狐美颜sdk1 小时前
直播APP开发完整流程:需求规划、UI设计、功能开发、美颜SDK接入全解析
大数据·人工智能·音视频·美颜sdk·美颜api
小码哥哥2 小时前
当企业软件开始“越界“:从单一工具到超级集合的架构演进
大数据·人工智能·架构
其美杰布-富贵-李2 小时前
05 多分类任务中的评估指标:Binary Metrics 如何扩展到 Multi-class?
大数据·人工智能·分类
珐恩AI-人工智能2 小时前
生成式引擎优化(GEO)全解:2026年AI检索时代企业长效流量运营方法论
大数据·人工智能·产品运营·流量运营·geo优化
天天爱吃肉82182 小时前
【工程师笔记|新能源整车电控一次过CISPR25/BCI,汽车EMC/EMI落地十大核心设计技巧】
大数据·人工智能·笔记·python·汽车
单词记忆方法研究3 小时前
探索上海背单词小程序品牌:高效学习工具的优化之路
大数据·学习·小程序
2601_957879333 小时前
没有视频团队的跨境电商,如何利用AI建立短视频内容生产体系?
大数据·人工智能
扶苏10023 小时前
同一个 Git 项目整出两份,切分支互不影响?两种方案实测
大数据·git·elasticsearch