【cluster_block_exception】写操作elasticsearch索引报错

news/2024/10/17 22:22:12/

【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.ppmy.cn/news/1003164.html

相关文章

Centos 7 安装 Python 时 zlib not available 错误解决

Centos 7 安装 Python 时 zlib not available 错误解决 报错信息&#xff0c; zipimport.ZipImportError: cant decompress data; zlib not available解决方法&#xff0c; sudo yum install -y zlib zlib-devel完结&#xff01;

深度优先搜索|417, 1020, 1254

深度优先搜索|417. 太平洋大西洋水流问题&#xff0c;1020. 飞地的数量&#xff0c;1254. 统计封闭岛屿的数目 太平洋大西洋水流问题飞地的数量统计封闭岛屿的数目 太平洋大西洋水流问题 这道题只能写逆流&#xff01;&#xff01;顺流试了好几次内存都不够&#xff0c;所以只…

CAD产品设计逆向软件 FARO RevEng Crack

CAD产品设计逆向软件 FARO RevEng 软件平台能为用户带来全面的数字设计体验。该反向工程软件有助于利用三维点云创建和编辑高质量的网格和 CAD 表面&#xff0c;以实现反向工程工作流程。然后&#xff0c;工业设计师可以利用这些网格模型进行进一步设计或三维打印。 RevEng 的商…

结构体和 Json 相互转换(序列化反序列化)

关于 JSON 数据 JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。易于人阅读和编写。同时也 易于机器解析和生成。RESTfull Api 接口中返回的数据都是 json 数据。 Json 的基本格式如下&#xff1a; { "a": "Hello", "b": "…

自创送别诗比赛——送别诗

自创送别诗比赛——送别诗 规则&#xff1a; 1&#xff1a;必须原创&#xff0c;不得使用其他工具 2&#xff1a;必须是边塞诗 3&#xff1a;时间控制在1小时 4&#xff1a;可以不写名字和标题 ****** 现代【**骞】 离别之时情难舍&#xff0c; 相聚已成过去形。 岁月…

【JS交互篇】BOM基础、Window、Location、Navagator、Screen、History对象

一、BOM 概述 在 JavaScript 语言中有三种对象&#xff1a;内置对象、宿主对象、自定义对象。 宿主对象就是执行 JavaScript 脚本的环境所提供的对象。对于网页编程来说&#xff0c;js 是运行在浏览器上的&#xff0c;所以对于网页编程来说&#xff0c;宿主对象就是浏览器对象…

数据库导出Excel格式的表结构

数据库导出Excel格式的表结构 你是否遇到到导出数据库里面的表结构&#xff0c;包含字段名称、类型、长度、小数、默认值、字段描述之类的需求&#xff1b;当我们去navcat里面找时发现没有&#xff0c;因为navcat没有提供这一功能&#xff0c;他只可以导出表结构的sql&#xff…

H5实现签字版签名功能

前言&#xff1a;H5时常需要给C端用户签名的功能&#xff0c;以下是基于Taro框架开发的H5页面实现 一、用到的技术库 签字库&#xff1a;react-signature-canvas主流React Hooks 库&#xff1a;ahooks 二、组件具体实现 解决H5样式问题&#xff0c;主要还是通过两套样式实现…