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

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

相关推荐
德昂信息dataondemand30 分钟前
销售分析中的痛点与解决之道
大数据·数据分析
jkyy201442 分钟前
健康监测驾驶系统赋能:解锁新能源汽车健康出行新场景
大数据·人工智能·物联网·健康医疗
归去来?1 小时前
记录一次从https接口提取25G大文件csv并落表的经历
大数据·数据仓库·hive·python·网络协议·5g·https
龙山云仓2 小时前
No131:AI中国故事-对话荀子——性恶论与AI约束:礼法并用、化性起伪与算法治理
大数据·人工智能·深度学习·算法·机器学习
2501_933670793 小时前
2026年中专大数据技术专业可考证书清单
大数据
九河云3 小时前
纺织印染“数字色差仪”:光谱+AI模型一次调色成功省染料12%
大数据·人工智能·安全·机器学习·数字化转型
2502_911679143 小时前
KEYSIGHT是德 N1912A功率计:宽带多通道功率测量的标杆之选
大数据·网络·信息与通信·信号处理
玄微云4 小时前
当暖心服务遇见硬核AI:玄微子AI让孕产关怀更有温度
大数据·人工智能·科技·物联网·产康门店
SeaTunnel5 小时前
Apache SeaTunnel MySQL CDC 支持按时间启动吗?
大数据·数据库·mysql·开源·apache·seatunnel
isNotNullX5 小时前
什么是可信数据空间?为什么可信数据空间是数据共享的关键?
大数据·人工智能·数据安全·数据空间