3

Our Elasticsearch cluster went down and when I tried to restart it with:

docker start -i elasticsearch

I get the error:

Error: encountered environment variables that are no longer supported
Use jvm.options or ES_JAVA_OPTS to configure the JVM
ES_HEAP_SIZE=6g: set -Xms6g and -Xmx6g in jvm.options or add "-Xms6g -Xmx6g" to ES_JAVA_OPTS

I'm not quite sure where to set the options for this. I modified our elasticsearch.service file to include it on start:

ExecStart=/usr/bin/docker run --name elasticsearch -p ####:#### -p ####:#### -e ES_HEAP_SIZE=6g -e ES_JAVA_OPTS="-Xms6g -Xmx6g" -v /srv/esconfig:/usr/share/elasticsearch/confg

But the error persists.

2
  • 1
    What is base image and elastic search version in use? When you say, the environment was down, it must be running earlier. Was head sizes set earlier? or are you setting for the first time now? Commented Nov 10, 2016 at 3:58
  • I believe they are the latest Elasticsearch 5.0.0. The only option that was set earlier was ES_HEAP_SIZE. It wasn't until recently that the environment variables error showed up. Commented Nov 10, 2016 at 14:17

1 Answer 1

1

You shouldn't use ES_HEAP_SIZE anymore in your run statement, it's replaced to ES_JAVA_OPTS.

However, -e ES_JAVA_OPTS="-Xms6g -Xmx6g" will work only if -Xms2g and -Xmx2g options are commented out in /etc/elasticsearch/jvm.options file. Or you can skip both ES_HEAP_SIZE and ES_JAVA_OPTS env variables and configure your heap settings using jvm.options file.

Detailed descriptions can be found here: https://www.elastic.co/guide/en/elasticsearch/reference/5.1/heap-size.html

Example:

docker run --name=elasticsearch -p 9200:9200 -p 9300:9300 -v /data/elk-conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /data/elk-conf/jvm.options:/etc/elasticsearch/jvm.options -d elasticsearch:5.1.1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.