“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】

简介: es异常

@[toc]

异常

{
    "error": {
        "root_cause": [{
            "type": "circuit_breaking_exception",
            "reason": "[parent] Data too large, data for [] would be [7201130054/6.7gb], which is larger than the limit of [7103712460/6.6gb], real usage: [7201129672/6.7gb], new bytes reserved: [382/382b], usages [request=0/0b, fielddata=19998/19.5kb, in_flight_requests=21400104/20.4mb, model_inference=0/0b, accounting=10053032/9.5mb]",
            "bytes_wanted": 7201130054,
            "bytes_limit": 7103712460,
            "durability": "TRANSIENT"
        }],
        "type": "circuit_breaking_exception",
        "reason": "[parent] Data too large, data for [] would be [7201130054/6.7gb], which is larger than the limit of [7103712460/6.6gb], real usage: [7201129672/6.7gb], new bytes reserved: [382/382b], usages [request=0/0b, fielddata=19998/19.5kb, in_flight_requests=21400104/20.4mb, model_inference=0/0b, accounting=10053032/9.5mb]",
        "bytes_wanted": 7201130054,
        "bytes_limit": 7103712460,
        "durability": "TRANSIENT"
    },
    "status": 429
}

原因

相信这个原因大家都查到了,那么看文末的详细解析。

field data的缓存不够用

解决

设置 fielddata 缓存占用 JVM 内存的 40% 或更小

curl -XPUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d '{
  "persistent" : {
    "indices.breaker.fielddata.limit" : "40%" 
  }
}'

返回:

{
    "acknowledged": true,
    "persistent": {
        "indices": {
            "breaker": {
                "fielddata": {
                    "limit": "40%"
                }
            }
        }
    },
    "transient": {}
}

elasticsearch fielddata理解

在es中,text类型的字段使用一种叫做fielddata的查询时内存数据结构。当字段被排序,聚合或者通过脚本访问时这种数据结构会被创建。它是通过从磁盘读取每个段的整个反向索引来构建的,然后存存储在java的堆内存中。

  fileddata默认是不开启的。Fielddata可能会消耗大量的堆空间,尤其是在加载高基数文本字段时。一旦fielddata已加载到堆中,它将在该段的生命周期内保留。此外,加载fielddata是一个昂贵的过程,可能会导致用户遇到延迟命中。这就是默认情况下禁用fielddata的原因。如果尝试对文本字段进行排序,聚合或脚本访问,将看到以下异常:

  “Fielddata is disabled on text fields by default. Set fielddata=true on [your_field_name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory.”

  在启用fielddata之前,请考虑使用文本字段进行聚合,排序或脚本的原因。这样做通常没有意义。text字段在索引例如New York这样的词会被分词,会被拆成new,york。在此字段上面来一个terms的聚合会返回一个new的bucket和一个york的bucket,当你想只返回一个New York的bucket的时候就会出现问题。在kibana中执行如下的命令即可:

PUT my_index
{
  "mappings": {
    "_doc": {
      "properties": {
        "my_field": { 
          "type": "text",
          "fields": {
            "keyword": { 
              "type": "keyword"
            }
          }
        }
      }
    }
  }
}

然后使用my_field字段进行搜索。使用my_field.keyword字段进行聚合,排序或脚本。

可以使用PUT映射API在现有文本字段上启用fielddata,如下所示:

PUT my_index/_mapping/_doc
{
  "properties": {
    "my_field": { 
      "type":     "text",
      "fielddata": true
    }
  }
}

为my_field指定的映射应包含该字段的现有映射以及fielddata参数。

目录
相关文章
|
Web App开发 前端开发
【前端异常】Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
【前端异常】Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
769 0
|
3月前
|
Docker 容器
成功解决:Caused by: ParsingException[Failed to parse object: expecting token of type [START_OBJECT] but
这篇文章讨论了在使用Docker启动Elasticsearch容器时遇到的一个具体问题:由于配置文件`elasticsearch.yml`解析出错导致容器启动失败。文章提供了详细的排查过程,包括查看容器的日志信息、检查并修正配置文件中的错误(特别是空格问题),并最终成功重新启动了容器。
|
5月前
|
存储 缓存 自然语言处理
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
47 1
error ‘res‘ is assigned a value but never used no
error ‘res‘ is assigned a value but never used no
|
6月前
|
应用服务中间件 Python 容器
ERROR [ntContainer#0-1] o.s.a.r.l.SimpleMessageListenerContainer 1917: Failed to check/redeclare aut
ERROR [ntContainer#0-1] o.s.a.r.l.SimpleMessageListenerContainer 1917: Failed to check/redeclare aut
238 0
|
Java Maven Android开发
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
122 0
|
6月前
|
Perl
报错:error Parsing error: x-invalid-end-tag
报错:error Parsing error: x-invalid-end-tag
140 0
error: static assertion failed: Signal and slot arguments are not compatible.
error: static assertion failed: Signal and slot arguments are not compatible.
error: static assertion failed: Signal and slot arguments are not compatible.