ES 7.3.2 on CentOS: JvmOptionsParser - cannot resolve ES_TMPDIR

I'm trying to spin up multiple ES instances on a server, this used to work with ES 6.x, but does not work with the recent version:


export ES_PATH_CONF=${HOME}/etc/elasticsearch1
export ES_JAVA_OPTS="-Xms128m -Xmx128m"

elasticsearch \${ES_LOCAL_PORT} \${HOME}/data/elasticsearch${ES_LOCAL_PORT} \
        -Epath.logs=${HOME}/logs/elasticsearch${ES_LOCAL_PORT} \
        -Ehttp.port=${ES_LOCAL_PORT} \

I took the standard jvm.options and replaced the paths to GC files:

$ grep ES_TMPDIR "${HOME}/etc/elasticsearch1/jvm.options"${ES_TMPDIR}

And the JvmOptionsParser from the ES start script cannot resolve the variable anymore:

Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
[0.000s][error][logging] Error opening log file '${ES_TMPDIR}/gc.log': No such file or directory
[0.000s][error][logging] Initialization of output 'file=${ES_TMPDIR}/gc.log' using options 'filecount=32,filesize=64m' failed.
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=${ES_TMPDIR}/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Again, it worked for ES 6.x.

can you open a github issue for this one, please? If it worked on 6.x this feels like a bug to me.

As a workaround for now, you can probably just hardcode the path in the gc log configuration line.

I've opened already:
as a workaround I just commented the line out, because I don't want many instances to be writing into the same file (jvm.options is shared) :slight_smile:

1 Like

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