logstash with java10 get error : Unrecognized VM o

2020-06-09 03:50发布

I'm running logstash with java10 ,like this commond:

./logstash -f std_std.conf

but I get this error:

Unrecognized VM option 'UseParNewGC'

Error: Could not create the Java Virtual Machine.

Error: A fatal exception has occurred. Program will exit.

Thank you so mach


sorry ,not suport java 10 ~~~~ closed~

标签: logstash
4条回答
等我变得足够好
2楼-- · 2020-06-09 04:08

In the Elastic documentation for installing Logstash, it was mentioned that Logstash requires Java 8.

Logstash requires Java 8. Java 9 is not supported. Use the official Oracle distribution or an open-source distribution such as OpenJDK.

You can download Java 8 and try again. Hope it helps.

$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

$ ./bin/logstash -f logstash.conf 
Sending Logstash's logs to ...
查看更多
霸刀☆藐视天下
3楼-- · 2020-06-09 04:11

According to the install guide... it is supported.

https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html

"Elasticsearch requires Java 8 or later. Use the official Oracle distribution or an open-source distribution such as OpenJDK."

查看更多
一纸荒年 Trace。
4楼-- · 2020-06-09 04:12

You probably have Java 10 (not proper version). You should install Java 8 (Ubuntu solution):

sudo apt install openjdk-8-jdk

It won't automatically change your default java compiler. Your should make it by your own. Change default java compiler:

sudo update-alternatives --config java

Type 0 or 1 or 2 ... option. Probably last entry. Now:

./logstash -f ../your-logstash-file.conf
查看更多
做个烂人
5楼-- · 2020-06-09 04:30

As @kylekong said, java 10 is not supported. You could install java 8 instead. Using Ubuntu you should do something like this:

sudo -i
apt-get update
apt-get install openjdk-8-jre-headless -y
apt-get install openjdk-8-jdk-headless -y
java -version
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
apt-get install apt-transport-https
apt-get update && apt-get install logstash
exit

Then you can start Logstash with:

sudo systemctl start logstash

Reference: https://www.elastic.co/guide/en/logstash/current/installing-logstash.html

查看更多
登录 后发表回答