How to set Elicsearch 5 memory size (heap) when working as a service

In Elasticsearch 5.x it works as a service, how can I set the memory (heap) size?

Environment Variables

ES_MIN_MEM   ES_MAX_MEM    ES_HEAP_SIZE

cannot be read or taken into account when starting Elasticsearch as a service through Systemd on Debian-based distributions (Ubuntu, Mint, etc.), using

sudo service elasticsearch start
+4
source share
1 answer

In ElasticSearch 5.x after October 26, 2016, the old methods for setting the memory size no longer work.

For example: after changing ES_HEAP_SIZE in / etc / default / elasticsearch and in etc / init.d / elasticsearch, if you run   ps aux | grep elasticsearchyou will still get

/usr/bin/java -Xms2g -Xmx2g 2G min and 2G max RAM value

You must make changes to

/etc/elasticsearch/jvm.options

Xms
Xmx , , :

-Xms16g

-Xmx16g

( )

Elasticsearch 5 -Xms2g -Xmx2g

+6

Source: https://habr.com/ru/post/1663974/


All Articles