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

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

异常

{
  "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参数。


目录
相关文章
|
8月前
|
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.
522 0
|
1月前
|
JavaScript 安全 网络安全
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
1047 0
|
1月前
|
Perl
报错:error Parsing error: x-invalid-end-tag
报错:error Parsing error: x-invalid-end-tag
|
6月前
|
JavaScript
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
Uncaught runtime errors: × ERROR Avoided redundant navigation to current location: “/xxx“.
81 0
|
关系型数据库 MySQL C++
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
135 0
没解决:RuntimeWarning: tp_compare didn't return -1 or -2 for exception
没解决:RuntimeWarning: tp_compare didn't return -1 or -2 for exception
73 0
|
Linux
WARNING: Re-reading the partition table failed with error 22: Invalid argument
在划分磁盘分区时,遇到错误“WARNING: Re-reading the partition table failed with error 22: Invalid argument” 如下所示: [root@DB-Server u02]# fdisk -l   Disk /dev/sda: 500.
2493 0
|
Go iOS开发
The operation couldn’t be completed. Unable to log in with account 'myappleid'. An unexpected failure occurred while logging in (Underlying error code 1100).解决方法
The operation couldn’t be completed. Unable to log in with account 'myappleid'. An unexpected failure occurred while logging in (Underlying error code 1100).解决方法
375 0
2015-03-18 - Deliberately pass a wrong note type for my task creation
2015-03-18 - Deliberately pass a wrong note type for my task creation
80 0
2015-03-18 - Deliberately pass a wrong note type for my task creation