1. 程式人生 > 實用技巧 >解決 es CircuitBreakingException 問題(Data too large Error)

解決 es CircuitBreakingException 問題(Data too large Error)

[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%"
        }
      }
    },
}