Elasticsearchのメモリサイズ設定

Elasticsearchのメモリサイズ設定

elasticsearch のインストール ディレクトリを見つけて、関連する設定ファイルが含まれている config フォルダーを見つけます。

公式は、jvm.options を直接変更することを推奨していませんが、jvm.options を jvm.options.d ディレクトリにコピーしてから変更します。

このうち、jvm.options は es 実行時のメモリ割り当てを変更できます。jvm.options ファイルを開くと、デフォルトのメモリが 4g であることがわかります。

################################################################
## 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,
## which should be named with .options suffix, 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
## -Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/8.6/heap-size.html
## for more information
##
###############################################################

メモリを必要な実際のサイズに変更して保存し、es を再起動します。

おすすめ

転載: blog.csdn.net/fhw925464207/article/details/131060932