The Elasticsearch service is memory-intensive. By default, the Elasticsearch service is
configured to use a minimum and maximum heap size of 2 GB. You can override these default values
by making changes in the Elasticsearch Warden configuration file and the
jvm.options file. Restart Elasticsearch after you modify the
settings.
/opt/mapr/conf/conf.d/warden.elasticsearch.conf directory. Modify the
service.heapsize.min and service.heapsize.max values set
in warden.elasticsearch.conf, as
shown:service.heapsize.min=2000
service.heapsize.max=2000
The service.heapsize.min and service.heapsize.max values
are set in megabytes as an integer. For older MEPs, you must make sure that the
-Xms and -Xmx values in the jvm.options file match the
settings in the Warden configuration file.
The jvm.options file centralizes arguments to the Java Virtual Machine to
simplify the management of the JVM options. You can no longer set the JVM options through
the ES_MIN_MEM, ES_MAX_MEM, ES_HEAP_SIZE, ES_HEAP_NEWSIZE, ES_DIRECT_SIZE,
ES_USE_IPV4,ES_GC_OPTS, ES_GC_LOG_FILE, and JAVA_OPTS environment variables.
jvm.options file in config/jvm.options. If you
installed ElasticSearch from the Debian or RPM packages, you can locate the
jvm.options file in the
$ES_HOME/etc/elasticsearch/jvm.options directory, for
example:/opt/mapr/elasticsearch/elasticsearch-<version>/etc/elasticsearchTo specify an alternative location, set the ES_JVM_OPTIONS environment variable to the file path.
jvm.options file is not required for MEPs 6.2.0, 6.1.1, 6.0.2 and later, which contain logic
to edit the jvm.options file automatically. For other MEPs, you must ensure
that memory-configuration changes are made both in the Warden configuration file and
in thejvm.options file.-Xms and -Xmx values in the
jvm.options file set the Elasticsearch heap size, as
shown:-Xms2g
-Xmx2g
The -Xms parameter sets the minimum heap size in gigabytes. The
-Xmx parameter sets the maximum heap size in gigabytes. Elasticsearch
recommends that both parameters have the same value.
maprcli node services -name elasticsearch -nodes <space separated list of Elasticsearch nodes> -action restartbootstrap.mlockall: true option
in $ES_HOME/etc/elasticsearch/elasticsearch.yml.For more information, see the Elasticsearch documentation.