“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参数。

目录
相关文章
|
5月前
|
Docker 容器
成功解决:Caused by: ParsingException[Failed to parse object: expecting token of type [START_OBJECT] but
这篇文章讨论了在使用Docker启动Elasticsearch容器时遇到的一个具体问题:由于配置文件`elasticsearch.yml`解析出错导致容器启动失败。文章提供了详细的排查过程,包括查看容器的日志信息、检查并修正配置文件中的错误(特别是空格问题),并最终成功重新启动了容器。
|
7月前
|
存储 缓存 自然语言处理
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
“error“: { “root_cause“: [{ “type“: “circuit_breaking_exception“, “reason“: “[parent] D【已解决】
57 1
|
JavaScript
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
210 0
|
程序员 Go API
译|Don’t just check errors, handle them gracefully(一)
译|Don’t just check errors, handle them gracefully
86 0
|
Java Go API
译|Don’t just check errors, handle them gracefully(二)
译|Don’t just check errors, handle them gracefully(二)
104 0
|
消息中间件
Error: unable to perform an operation on node ‘rabbit@PC-201712061807‘. Please see diagnostics infor
Error: unable to perform an operation on node ‘rabbit@PC-201712061807‘. Please see diagnostics infor
367 0
Error: unable to perform an operation on node ‘rabbit@PC-201712061807‘. Please see diagnostics infor
|
索引
ES报错:“type“=>“cluster_block_exception“, “reason“=>“blocked by: [FORBIDDEN/12/index read-only / allow
ES报错:“type“=>“cluster_block_exception“, “reason“=>“blocked by: [FORBIDDEN/12/index read-only / allow
392 0
ES报错:“type“=>“cluster_block_exception“, “reason“=>“blocked by: [FORBIDDEN/12/index read-only / allow
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.
|
网络协议 关系型数据库 Linux
onfigure: error: no acceptable C compiler found in $PATH See `config.log' for more details 问题解决
onfigure: error: no acceptable C compiler found in $PATH See `config.log' for more details 问题解决
198 0

热门文章

最新文章

下一篇
开通oss服务