跳转至

4.修改es的使用内存为2G

1. 修改elasticsearch的使用内存为2G

1. 修改配置文件

cd /etc/elasticsearch
ls
vim jvm.options
# 开启31和32行,设置内存使用大小为2G
 19 ################################################################
 20 ## IMPORTANT: JVM heap size
 21 ################################################################
 22 ##
 23 ## The heap size is automatically configured by Elasticsearch
 24 ## based on the available memory in your system and the roles
 25 ## each node is configured to fulfill. If specifying heap is
 26 ## required, it should be done through a file in jvm.options.d,
 27 ## and the min and max should be set to the same value. For
 28 ## example, to set the heap to 4 GB, create a new file in the
 29 ## jvm.options.d directory containing these lines:
 30 ##
 31 -Xms2g
 32 -Xmx2g
 33 ##
 34 ## See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/heap-size.html
 35 ## for more information

2. 重启elasticsearch

systemctl restart elasticsearch

最后更新: 2022-02-19 13:05:46