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

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

相关推荐
huashengzsj9 分钟前
渠道数据管理用什么工具 新零售渠道数据管理系统推荐
大数据·人工智能·零售
TMT星球17 分钟前
松延动力推出具身智能子品牌Scalabot:让智能,在真实世界生长
大数据·人工智能
buligbulig18 分钟前
数据石油 vs. 情绪基因:小数据时代正在反攻
大数据
金融Tech趋势派22 分钟前
2026企业微信SCRM服务商选型指南:官方认证、安全合规、产品能力全维度核验
大数据·安全·企业微信
m0_547486661 小时前
《大数据导论》全套PPT课件2026
大数据
猴子15516811 小时前
360度评估怎么让打分更客观一些?2026各项权重怎么设才合理
大数据·经验分享
CHANCE V1 小时前
Elasticsearch 进阶
大数据·elasticsearch·搜索引擎
xqqxqxxq1 小时前
AI Agent学习:第四章小结及八道思考题(李博杰《深入理解 AI Agent》第四章观后总结)
大数据·人工智能·学习
汇海老周1 小时前
《金融炼金术》第三课:从反身性到繁荣—萧条——理解正反馈机制
大数据·金融
Aloudata2 小时前
语义治理 vs 知识治理:AI 数据分析需要业务知识库还是可执行语义层
大数据·人工智能·数据分析·data agent·语义层