当前位置: 首页 > news >正文

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

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

http://www.lryc.cn/news/113411.html

相关文章:

  • chaitin-Nginx+Docker
  • 具体面试题
  • Logback ThresholdFilter LevelFilter
  • python+django+mysql项目实践二(前端及数据库)
  • Kubernetes高可用集群二进制部署(五)kubelet、kube-proxy、Calico、CoreDNS
  • 拦截器对接口细粒度权限校验
  • 计算机科技历史纵横:8月6日的十大里程碑
  • 知识图谱实战应用23-【知识图谱的高级用法】Neo4j图算法的Cypher查询语句实例
  • C++ 头文件函数大全
  • 智慧物流园区整体架构方案【46页PPT】
  • llama2模型下载
  • C高级【day4】
  • 【前端实习生备战秋招】—HTML 和 CSS面试题总结(一)
  • 【从零学习python 】02. 开发工具介绍
  • Python:Spider爬虫工程化入门到进阶(2)使用Spider Admin Pro管理scrapy爬虫项目
  • CubeMap convert into Octahedral思路
  • vue项目实战-脑图编辑管理系统kitymind百度脑图
  • c++调用ffmpeg api录屏 并进行rtmp推流
  • SQL分类及通用语法数据类型(超详细版)
  • 配置Hive远程服务详细步骤
  • Java中实现图片和Base64的互相转化
  • 视频添加字幕
  • Vue VS React:两大前端框架的对比与分析
  • 【机密计算标准解读】 基于TEE的安全计算(IEEE 2952)
  • 程序员编写文档的 10 个技巧
  • 【ES问题总结】
  • 数据结构----结构--线性结构--顺序存储--数组
  • docker 启动kitex 的opentelemetry
  • Excel中——日期列后添加星期
  • 谈谈DNS是什么?它的作用以及工作流程