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

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

相关推荐
DBA大董19 分钟前
云环境部署TDengine的那些坑
大数据·时序数据库·tdengine
阿坤带你走近大数据1 小时前
数据湖的构建实施方法论
大数据·数据湖·湖仓一体
安徽必海微马春梅_6688A1 小时前
实验a 信息化集成化生物信号采集与处理系统
大数据·人工智能·深度学习·信号处理
焦糖玛奇朵婷1 小时前
盲盒小程序:开发视角下的功能与体验
java·大数据·jvm·算法·小程序
野豹商业评论1 小时前
千问App全球首发点外卖、买东西、订机票等AI购物功能
大数据·人工智能
yhdata2 小时前
2026年镍合金线行业产业链分析报告
大数据·人工智能
汇智信科3 小时前
智慧矿山和工业大数据解决方案“安全生产数据综合分析系统
大数据·人工智能·安全·智能算法·智慧矿山·工业大数据·汇智信科
雨大王5123 小时前
汽车工厂智能调度系统:自适应调度算法如何解决资源与任务匹配难题?
大数据·人工智能·汽车·制造
雨大王5123 小时前
缩短交付周期:汽车企业如何通过计划智能体实现高效协同?
大数据·人工智能·汽车·制造
专注数据的痴汉3 小时前
「数据获取」内蒙古地理基础数据(道路、水系、四级行政边界、地级城市、DEM等)
大数据·人工智能·信息可视化