Elasticsearch 7.8 does not stat Java problem

Hi,
I am trying to fresh install and launch Elasticsearch 7.8 on RHEL 7.8 but I am getting into some kind of Java problems. I want it to run standalone.
Tried various ways I found on internet to fix it. But none helped. Any idea whats wrong?

journalctl -xe

> systemd[1]: Starting Elasticsearch...
> -- Subject: Unit elasticsearch.service has begun start-up
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> -- 
> -- Unit elasticsearch.service has begun starting up.
> ... systemd-entrypoint[1852]: Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
> ... systemd-entrypoint[1852]: output:
> ... systemd-entrypoint[1852]: error:
> ... systemd-entrypoint[1852]: OpenJDK 64-Bit Server VM warning: Ignoring option UseConcMarkSweepGC; support was removed in 14.0
> ... systemd-entrypoint[1852]: OpenJDK 64-Bit Server VM warning: Ignoring option CMSInitiatingOccupancyFraction; support was removed in 14.0
> ... systemd-entrypoint[1852]: OpenJDK 64-Bit Server VM warning: Ignoring option UseCMSInitiatingOccupancyOnly; support was removed in 14.0
> ... systemd-entrypoint[1852]: Unrecognized VM option 'PrintGCDateStamps'
> ... systemd-entrypoint[1852]: Error: Could not create the Java Virtual Machine.
> ... systemd-entrypoint[1852]: Error: A fatal exception has occurred. Program will exit.
> ... systemd-entrypoint[1852]: at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:126)
> ... systemd-entrypoint[1852]: at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:88)
> ... systemd-entrypoint[1852]: at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:59)
> ... systemd-entrypoint[1852]: at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:137)
> ... systemd-entrypoint[1852]: at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:95)
> ... systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
> ... systemd[1]: Failed to start Elasticsearch.
> -- Subject: Unit elasticsearch.service has failed
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> -- 
> -- Unit elasticsearch.service has failed.
> -- 
> -- The result is failed.



##### Configuration:
#### jvm.options

-Xms2g
-Xmx2g
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+DisableExplicitGC
-XX:+AlwaysPreTouch
-server
-Xss1m
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djna.nosys=true
-Djdk.io.permissionsUseCanonicalPath=true
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true
-Dlog4j.skipJansi=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintTenuringDistribution
-XX:+PrintGCApplicationStoppedTime
-Xloggc:/var/log/elasticsearch/gc.log
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=8
-XX:GCLogFileSize=64m

#### /etc/sysconfig/elasticsearch

#ES_HOME=/usr/share/elasticsearch
#CONF_DIR=/etc/elasticsearch
DATA_DIR=/var/lib/elasticsearch
LOG_DIR=/var/log/elasticsearch
#PID_DIR=/var/run/elasticsearch
ES_JAVA_OPTS="-Xms31g -Xmx31g"
#ES_HEAP_NEWSIZE=
#ES_DIRECT_SIZE=
#ES_JAVA_OPTS=
#ES_RESTART_ON_UPGRADE=true
ES_GC_LOG_FILE=/var/log/elasticsearch/gc.log
#ES_USER=elasticsearch
#ES_GROUP=elasticsearch
ES_STARTUP_SLEEP_TIME=5
MAX_OPEN_FILES=262140
#MAX_LOCKED_MEMORY=unlimited
#MAX_MAP_COUNT=262144

#### yum list installed | grep java
java-1.8.0-openjdk.x86_64             1:1.8.0.252.b09-2.el7_8     
java-1.8.0-openjdk-headless.x86_64    1:1.8.0.252.b09-2.el7_8
javapackages-tools.noarch             3.4.1-11.el7

Seems the 'Unrecognized VM option 'PrintGCDateStamps'' is the key - find a way to not set that I guess. Seems odd the new install would include that unless you are getting the wrong version of Java, but seems to be using the V14 JVM.

Yes, I have copied config from older server at some point, and it seems that some of parameters are now comparable. I have fixed the problem by throwing away parameters one by one from jvm.options file:

-Xms2g
-Xmx2g
-Djava.io.tmpdir=/data/elk/tmp
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+DisableExplicitGC
-XX:+AlwaysPreTouch
-server
-Xss1m
-Djava.awt.headless=true
-Dfile.encoding=UTF-8
-Djna.nosys=true
-Djdk.io.permissionsUseCanonicalPath=true
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true
-Dlog4j.skipJansi=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:+PrintGCDetails
#-XX:+PrintGCDateStamps
#-XX:+PrintTenuringDistribution
#-XX:+PrintGCApplicationStoppedTime
-Xloggc:/var/log/elasticsearch/gc.log
#-XX:+UseGCLogFileRotation
#-XX:NumberOfGCLogFiles=8
#-XX:GCLogFileSize=64m

1 Like

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