LoginSignup
5
0

More than 5 years have passed since last update.

Elasticsearchの5系をECS上で起動しようとしてエラーになった時の対応方法

Posted at

ECS上で動いていたElasticsearchを2.3を5.2にバージョンアップしてエラーが出た際の対応記録です。

メモリエラーへの対応

エラーログ
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)

ホスト側で解決するならswap領域メモリの量を増やすことで解決します。
http://qiita.com/waytoa/items/7010cfe2852d816c9513

docker内で解決するならJavaのヒープサイズを設定しても良いようです。

FDエラーへの対応

エラーログ
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

ホスト側のulimitの設定をしてもdocker側には反映されないので、docker起動時の引数で渡す必要があります。

docker run --ulimit nofile=1024:1024

ECS上ではスクリーンショットのようにNOFILEのリミットに対して、65536を割り当てます。

Screen Shot 2017-03-09 at 17.15.55.png

メモリマップ数エラーへの対応

エラーログ
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

ホスト側で設定した値がdocker側にも反映されたので以下で解決します。

sudo sysctl -w vm.max_map_count=262144
5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0