For some reason, I am getting the following JVM error when starting elasticsearch 7.9.2 on CentOS7 after a yum upgrade. Any ideas? Thanks for any help:
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
error:
Unrecognized VM option 'UseConcMarkSweepGC'
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:126)
at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:88)
at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:59)
at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:137)
at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:95)
UPDATE:
So my automated approach of updating elasticsearch ignores any new versions of configuration files. Forcing reinstall using sudo apt install --reinstall -o Dpkg::Options::="--force-confask,confnew,confmiss" elasticsearch gave me an updated jvm.options that solves the issue. Here's the diff:
# diff jvm.options jvm.options.dpkg-old
36,38c36,38
< 8-13:-XX:+UseConcMarkSweepGC
< 8-13:-XX:CMSInitiatingOccupancyFraction=75
< 8-13:-XX:+UseCMSInitiatingOccupancyOnly
---
> -XX:+UseConcMarkSweepGC
> -XX:CMSInitiatingOccupancyFraction=75
> -XX:+UseCMSInitiatingOccupancyOnly
41,48c41,47
< # NOTE: G1 GC is only supported on JDK version 10 or later
< # to use G1GC, uncomment the next two lines and update the version on the
< # following three lines to your version of the JDK
< # 10-13:-XX:-UseConcMarkSweepGC
< # 10-13:-XX:-UseCMSInitiatingOccupancyOnly
< 14-:-XX:+UseG1GC
< 14-:-XX:G1ReservePercent=25
< 14-:-XX:InitiatingHeapOccupancyPercent=30
---
> # NOTE: G1GC is only supported on JDK version 10 or later.
> # To use G1GC uncomment the lines below.
> # 10-:-XX:-UseConcMarkSweepGC
> # 10-:-XX:-UseCMSInitiatingOccupancyOnly
> # 10-:-XX:+UseG1GC
> # 10-:-XX:G1ReservePercent=25
> # 10-:-XX:InitiatingHeapOccupancyPercent=30
I'm no Java expert, so to summarize: Make sure you use the latest jvm.options (don't forget to save a backup of your old one in case of custom modifications) and hopefully elasticsearch starts just fine.
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.