🙆

ElasticSearch起動トラブル

2022/06/05に公開

ElasticSearch7系を入れて起動させると下記エラーが発生したのでその時の解決策を残します。

エラー

journalctl -xeを実行すると下記エラーが吐き出されていた。

Jun 05 03:09:50 elastic systemd-entrypoint[14014]: [1]: encountered improperly formatted JVM option in [/etc/elasticsearch/jvm.options] on line number [32]: [   -Xms8g]
Jun 05 03:09:50 elastic systemd-entrypoint[14014]: [2]: encountered improperly formatted JVM option in [/etc/elasticsearch/jvm.options] on line number [34]: [   -Xmx8g]

原因

jvm.optionsで設定したメモリの項目に半角スペースが2つ空いていたことが原因でした。

/etc/elasticsearch/jvm.options
################################################################
## IMPORTANT: JVM heap size
################################################################
##
## The heap size is automatically configured by Elasticsearch
## based on the available memory in your system and the roles
## each node is configured to fulfill. If specifying heap is
## required, it should be done through a file in jvm.options.d,
## and the min and max should be set to the same value. For
## example, to set the heap to 4 GB, create a new file in the
## jvm.options.d directory containing these lines:
##
## -Xms4g
   -Xms8g
## -Xmx4g
   -Xmx8g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/7.17/heap-size.html
## for more information
##
################################################################

半角スペース削除!

##
## -Xms4g
-Xms8g
## -Xmx4g
-Xmx8g
##

これで無事起動が出来ました。

Discussion