Use jvm.options or ES_JAVA_OPTS to configure the JVM ES_HEAP_SIZE=16G: set -Xms16G and -Xmx16G in jvm.options or add "-Xms16G -Xmx16G" to ES_JAVA_OPTS

At the moment I’ve been trying to run elasticsearch 5.2.2 as elastic user but I have been getting the following error.

Use jvm.options or ES_JAVA_OPTS to configure the JVM
ES_HEAP_SIZE=16G: set -Xms16G and -Xmx16G in jvm.options or add "-Xms16G -Xmx16G" to ES_JAVA_OPTS

I have tried changing the jvm.options by altering Xms and Xmx min and max heap size and adding this line to jvm.options

ES_JAVA_OPTS="-Xm16g -Xmx16g" ./bin/elasticsearch

But still getting the same error. I was hoping someone could assist.

Thanks

You wrote Xm instead of Xms here. Typo?

Hi David yes that was a typo. Even with ES_JAVA_OPTS="-Xms16g -Xmx16g" ./bin/elasticsearch I am still experiencing the same error.

Can you try:

ES_JAVA_OPTS="-Xms16G -Xmx16G" ./bin/elasticsearch

Just tried again now.

with ES_JAVA_OPTS="-Xms16G -Xmx16G" ./bin/elasticsearch

Still the same issue

Error: encountered environment variables that are no longer supported
Use jvm.options or ES_JAVA_OPTS to configure the JVM
ES_HEAP_SIZE=16G: set -Xms16G and -Xmx16G in jvm.options or add "-Xms16G -Xmx16G" to ES_JAVA_OPTS

I also included the error but I'm unsure what that means?

Sounds like the env variable is still set. Can you remove it?

Okay how do I do that. Would I need to comment out

node.name:    ${HOSTNAME}
network.host: ${ES_NETWORK_HOST}

under

elasticsearch.yml

or do I need to perform another action?

No I meant removing ES_HEAP_SIZE

Yes I've removed ES_HEAP_SIZE but I still keep getting the same error.

I had a look under /etc/sysconfig/elasticsearch and /etc/init.d/elasticsearch to try and understand what the env variables were.

This is what I found

# Sets the default values for elasticsearch variables used in this script
ES_USER="elasticsearch"
ES_GROUP="elasticsearch"
ES_HOME="/usr/share/elasticsearch"
MAX_OPEN_FILES=65536
MAX_MAP_COUNT=262144
LOG_DIR="/var/log/elasticsearch"
DATA_DIR="/var/lib/elasticsearch"
CONF_DIR="/etc/elasticsearch"

Although further down I found this

# export unsupported variables so bin/elasticsearch can reject them and inform the user these are unsupported
if test -n "$ES_MIN_MEM"; then export ES_MIN_MEM; fi
if test -n "$ES_MAX_MEM"; then export ES_MAX_MEM; fi
if test -n "$ES_HEAP_SIZE"; then export ES_HEAP_SIZE; fi
if test -n "$ES_HEAP_NEWSIZE"; then export ES_HEAP_NEWSIZE; fi
if test -n "$ES_DIRECT_SIZE"; then export ES_DIRECT_SIZE; fi
if test -n "$ES_USE_IPV4"; then export ES_USE_IPV4; fi
if test -n "$ES_GC_OPTS"; then export ES_GC_OPTS; fi
if test -n "$ES_GC_LOG_FILE"; then export ES_GC_LOG_FILE; fi

If you really have the same exact error message, then I believe that something, somewhere is then setting ES_HEAP_SIZE. I'm sorry I can't help more but you probably need to find where it has been set. It can be in a ~/.profile, in a startup script...

BTW how did you install elasticsearch?

May be just download a new version (take the ZIP distribution), unzip it then just launch bin/elasticsearch and see what happens. Might give you a clue.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.