(译)elasticsearch 出现outofmemoryerror java heap space的可能原因

原文:http://stackoverflow.com/questions/30803404/what-are-the-possible-reasons-behind-the-java-lang-outofmemoryerror-java-heap-sp

我们在使用elasticsearch时,常常会遇到outofmemoryerror java heap space 的ERROR,但是我们却没法找到产生这个ERROR的背后正在的原因的描述日志。我们仅仅看到的ERROR描述如:

(2015-04-09 13:56:47,527 DEBUGaction.index Emil Blonsky observer: timeout notification from cluster service. timeout setting 1m, time since start 1m) Caused by: java.lang.OutOfMemoryError: Java heap space:

产生这类型错误的可能原因如下(部分):

1.读取过多的数据到内存,尤其是field data字段(在使用sorting和aggregations)

2.配置出错,设置的heap size没有生效,可能是设置错地方了。默认的heap size(min 256M,max 1G)是不够用的。

3.做索引的数据过多,比如bulk size设置过大

4.查询时,要求返回的数据量太大(size设置过大)

5.主节点的内存不够用,这种情况下可能是由于cluster state引起的。若索引使用大量的别名(alias),cluster state就会使用大量的内存。

 

PS:出现OOM的节点必须重启。

 

猜你喜欢

转载自ChenghuiZ.iteye.com/blog/2356434
今日推荐