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

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

相关推荐
研华嵌入式4 分钟前
研华国际论坛聚焦Physical AI与边缘计算 AI规模化应用时代正式开启
大数据·人工智能·边缘计算
谛听招标4 分钟前
【无标题】
大数据·人工智能
徐小青青啊6 分钟前
es集群不中断实时数据更新损坏节点硬盘
大数据·elasticsearch·搜索引擎·es
blue_dou14 分钟前
架构与能力边界解析:七款CRM产品四大核心维度对比测评
大数据·架构·逻辑回归·流程图
宸津-代码粉碎机15 分钟前
Spring AI 企业级RAG实战|增量更新+文档去重+定时自动入库生产落地方案
java·大数据·人工智能·后端·python·spring
二宝哥28 分钟前
大数据之数据仓库与数据库区别
大数据·数据库·数据仓库
西安同步高经理32 分钟前
国产音频频谱分析仪使用案例,多通道音频分析仪,音频频谱分析仪
大数据·人工智能·音视频
dingzd9533 分钟前
TikTok创作者AI搜索推出后跨境品牌如何提高达人匹配效率
大数据·人工智能·新媒体运营·市场营销·跨境
PcVue China37 分钟前
PcVue AI 智能管控:解锁建筑冷站能效新价值
大数据·人工智能·pid·建筑冷站