orenoblog

エンジニアになりたいExcel方眼紙erの物語

elasticsearchのエラーtips

動かしてる時に発生したエラー

環境: CentOS5

(1)max_content_lengthのエラー
http.max_content_lengthのデフォルト値は100MBです。
これを超えるログをPOSTする場合発生します。

[WARN ][http.netty               ] [Nebulos] Caught exception while handling client http traffic, closing connection ...(省略)
org.elasticsearch.common.netty.handler.codec.frame.TooLongFrameException: HTTP content length exceeded 104857600 bytes.
        at org.elasticsearch.common.netty.handler.codec.http.HttpChunkAggregator.messageReceived(HttpChunkAggregator.java:169)
        at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
http.max_content_length: 1024mb

(2)java heapサイズに関わるエラー

[WARN ][http.netty               ] [Ogress] Caught exception while handling client http traffic, closing connection ...(省略)
java.lang.OutOfMemoryError: Java heap space

heapサイズが不足してます.デフォルトは256MBなので、heap sizeを増やしましょう。
デフォルト運用は気がついたらelasticsearchが止まってしまうので避けましょう。

/etc/sysconfig/elasticsearch
ES_HEAP_SIZE=<heap_size>g