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

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

相关推荐
KKKlucifer4 分钟前
数据分类分级为基的跨域流通权限动态管控技术:构建安全可控的跨域数据流通体系
大数据·数据库·人工智能
数字化顾问9 分钟前
(63页PPT)智慧校园建设总体设计方案(附下载方式)
大数据
en-route25 分钟前
深入理解数据仓库架构:ODS、DWD、DWS 和 ADS 层的定义与应用
大数据·数据仓库
q***735540 分钟前
ES在SpringBoot集成使用
spring boot·elasticsearch·jenkins
WLJT1231231231 小时前
芯片与电流:点亮生活的科技力量
大数据·人工智能·科技·生活
syounger1 小时前
德军 SAP 迁移受阻:S4/HANA 系统功能不稳定,全面上线再度推迟
大数据·人工智能
B站计算机毕业设计之家2 小时前
Python+Flask 电商数据分析系统(Selenium爬虫+多元线性回归)商品数据采集分析可视化系统 实时监控 淘宝数据采集 大屏可视化 (附源码)✅
大数据·爬虫·python·selenium·机器学习·flask·线性回归
车传新2 小时前
Flink
大数据·flink
IT·小灰灰2 小时前
深度解析重排序AI模型:基于硅基流动API调用多语言重排序AI实战指南
java·大数据·javascript·人工智能·python·数据挖掘·php
一辉ComeOn2 小时前
【大数据高并发核心场景实战】 数据持久化层 - 分表分库
java·大数据·分布式·mysql·系统架构