Need help about starting logstash-8.11.2

I installed Logstash by downloading and unzipping the zip file from the official website
and it occurs an error about JDK ,

Using bundled JDK: /opt/logstash-8.11.2/jdk
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I tried to clean JAVA_HOME and it doesn't work.
I used the same way to install it on another machine, it worked just fine

What should I do?

Hi @AlexLWei,

Which Java JDKs do you have installed on the non-working machine versus working machine in addition to the bundled JDK?

There is a similar issue here suggesting that it's down to the JDK version.

THANKS FOR REPLAY!
The non-working machine have not install any jdk yet, and basa on the log generated by starting logstash, they use the logststash's JDK which bundled with logstash program, and the path is {logstash_root_path}/jdk

I use some simple commands(java / java -version / javac) to test if this JDK is available, and they work just fine.

BTW,the JDK version is 17.0.9

Can you copy full error lines from the logstash-plain.log file?

Hi,

Ensure that the JAVA_HOME environment variable is not set. If it's set, it might be pointing Logstash to use a different version of Java. You can unset it with the command unset JAVA_HOME.

Check the jvm.options file in the config directory of your Logstash installation. This file contains options that are passed to the JVM. Ensure that the 'UseConcMarkSweepGC' option is not present in this file.

Can you share the command line you are using to run Logstash?

If you are using the bundled jdk you should not get this error with the default java configurations.

It does not generate log files, instead, it directly outputs to the terminal
image

Do you have another logstash installed on this machine? Does the path /etc/logstash exists?

yes, I think exactly as you said, and I use the same way to install on another machine, it works without any error

yes, I just found somethine in this path, I tried to install logstash using rpm package before, but it ended with an error and I thought it might have failed to install it.
image

GOD! you are my SAVIOR!
Since I removed these files, it works!

If you installed the same version this shouldn't be an error also as the jvm.options would be the same.

Unless you installed a different version or the jvm.options was edited.

The issue was that your logstash on /opt/logstash-8.11.2 was using a different jvm.option where the file have the options in this way:

-XX:+UseConcMarkSweepGC

The correct jvm.options needs to have the option in this way:

11-13:-XX:+UseConcMarkSweepGC

It is hard to see how you could have a jvm.options dated Jun 14 2020 in a successful 8.11.2 rpm install without also having a jvm.options.rpmnew

1 Like

How about to go for fresh install 8.11.3? Make backup and install 8.11.3.

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