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

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

相关推荐
才盛智能科技43 分钟前
K链通×才盛云:自助KTV品牌从0到1孵化超简单
大数据·人工智能·物联网·自助ktv系统·才盛云
广州赛远1 小时前
IRB2600-201.65特殊机器人防护服清洗工具详解与避坑指南
大数据·人工智能
川西胖墩墩1 小时前
垂直模型价值:专业领域超越通用模型的竞争
大数据·人工智能
Data_Journal2 小时前
如何使用 Python 解析 JSON 数据
大数据·开发语言·前端·数据库·人工智能·php
威胁猎人2 小时前
【黑产大数据】2025年全球KYC攻击风险研究报告
大数据·区块链
迎仔2 小时前
00-大数据技术体系总览:大数据世界的“城市蓝图”
大数据
那起舞的日子2 小时前
ElasticSearch系列-3-java端整合CURD
elasticsearch
xixixi777772 小时前
互联网和数据分析中的核心指标 DAU (日活跃用户数)
大数据·网络·数据库·数据·dau·mau·留存率
绝缘体13 小时前
如何使用外卖霸王餐api接口?
大数据·搜索引擎·微信·pygame
幂链iPaaS4 小时前
市场六大专业iPaaS平台怎么选
大数据·人工智能