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:

ES_LOCAL_PORT=9100

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

elasticsearch \
        -Enode.name=node${ES_LOCAL_PORT} \
        -Epath.data=${HOME}/data/elasticsearch${ES_LOCAL_PORT} \
        -Epath.logs=${HOME}/logs/elasticsearch${ES_LOCAL_PORT} \
        -Ehttp.port=${ES_LOCAL_PORT} \
        -Etransport.port=1${ES_LOCAL_PORT}

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

$ grep ES_TMPDIR "${HOME}/etc/elasticsearch1/jvm.options"
-Djava.io.tmpdir=${ES_TMPDIR}
-XX:HeapDumpPath=${ES_TMPDIR}
-XX:ErrorFile=${ES_TMPDIR}/hs_err_pid%p.log
8:-Xloggc:${ES_TMPDIR}/gc.log
9-:-Xlog:gc*,gc+age=trace,safepoint:file=${ES_TMPDIR}/gc.log:utctime,pid,tags:filecount=32,filesize=64m

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]
output:
[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.
error:
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.
        at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:111)
        at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:79)
        at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:57)
        at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:89)

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: https://github.com/elastic/elasticsearch/issues/47133
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.