解决 es CircuitBreakingException 问题

比如频繁报如下错误,

[2019-06-16T15:31:22,778][DEBUG][o.e.a.a.c.n.i.TransportNodesInfoAction] [node-xxx] failed to execute on node [kQrOKwMhSZy8O42Hgs6sdg]
org.elasticsearch.transport.RemoteTransportException: [node-xxx][ ][cluster:monitor/nodes/info[n]]
Caused by: org.elasticsearch.common.breaker.CircuitBreakingException: [parent] Data too large, data for [<transport_request>] would be [9022404967/8.4gb], which is larger than the limit of [8995025715/8.3gb], usages [request=0/0b, fielddata=5886440013/5.4gb, in_flight_requests=2510/2.4kb, accounting=3135962444/2.9gb]

如果你google,可以搜到 https://blog.csdn.net/ypc123ypc/article/details/69944805

他那里面解决方案是调整 fielddata ,但此报错并非fielddata 缓存问题, 根本原因是[parent] 内存不够了,根据es 的文档 ,https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker.html 里面写的比较清楚,

indices.breaker.total.limit
    Starting limit for overall parent breaker, defaults to 70% of JVM heap if indices.breaker.total.use_real_memory is false. If indices.breaker.total.use_real_memory is true, defaults to 95% of the JVM heap.

这个值默认是70%
用devtool 把限制暂时去掉

PUT /_cluster/settings{
{
  "indices" : {
      "breaker" : {
        "fielddata" : {
          "limit" : "100%"
        },
        "total" : {
          "limit" : "80%"
        }
      }
    },
}

原文地址:https://www.cnblogs.com/gqdw/p/11032994.html