Hi,
I'm upgrading a single node, dev instance of elasticsearch running 6.4.2 to 7.12.1 as the first step in getting ready to upgrade our prod cluster. I was able to upgrade from 6.4.2 -> 6.8.15 without issue but on upgrading to 7.12.1, I see this error on startup:
May 18 15:36:01 ews-dev11 elasticsearch: could not find java in bundled JDK at /data/elasticsearch-sw/jdk/bin/java
But:
bash-4.2# data/elasticsearch-sw/jdk/bin/java -version
openjdk version "16" 2021-03-16
OpenJDK Runtime Environment AdoptOpenJDK (build 16+36)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 16+36, mixed mode, sharing)
I did some research but wasn't able to get it to start using the bundled jdk. In my systemd startup script, I added:
Environment=ES_JAVA_HOME=/
Which makes it use the old, default java install on the box in /bin which of course results in this warning:
May 18 16:13:24 ews-dev11 elasticsearch: Future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/java/jre] does not meet this requirement. Consider switching to a distribution of Elasticsearch with a bundled JDK. If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set.
This worked but I'd much prefer to use the bundled jdk
I'm running on a centos 7 server that's fairly well locked down and I have to run everything out of the /data directory on the box. elasticsearch-sw is a symlink to a directory (elasticsearch-sw -> /data/bin/elasticsearch-7.12.1) where I unzipped elasticsearch install.
JAVA_HOME is not set and prior to adding it, ES_JAVA_HOME wasn't being set in my systemd startup script.
After posting my question, I thought it might be that the user running elasticsearch might not have access to the bundled jvm so I fixed the permissions and commented out the reference to ES_JAVA_HOME from my startup script but now I see this set of errors:
May 18 17:00:52 ews-dev11 elasticsearch: Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
May 18 17:00:52 ews-dev11 elasticsearch: output:
May 18 17:00:52 ews-dev11 elasticsearch: error:
May 18 17:00:52 ews-dev11 elasticsearch: Unrecognized VM option 'UseConcMarkSweepGC'
May 18 17:00:52 ews-dev11 elasticsearch: Error: Could not create the Java Virtual Machine.
May 18 17:00:52 ews-dev11 elasticsearch: Error: A fatal exception has occurred. Program will exit.
May 18 17:00:52 ews-dev11 elasticsearch: at org.elasticsearch.tools.launchers.JvmOption.flagsFinal(JvmOption.java:119)
May 18 17:00:52 ews-dev11 elasticsearch: at org.elasticsearch.tools.launchers.JvmOption.findFinalOptions(JvmOption.java:81)
May 18 17:00:52 ews-dev11 elasticsearch: at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:38)
May 18 17:00:52 ews-dev11 elasticsearch: at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:135)
May 18 17:00:52 ews-dev11 elasticsearch: at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:86)
May 18 17:00:52 ews-dev11 systemd: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
May 18 17:00:52 ews-dev11 systemd: Unit elasticsearch.service entered failed state.
May 18 17:00:52 ews-dev11 systemd: elasticsearch.service failed.
Is it always gonna be there? Shouldn't I just leave it unset so it will default to the bundled jvm? I think the initial problem was file permissions - I has unzipped the bits as root. I could also go with specifically setting to /data/elasticsearch-sw/jdk
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.