我尝试在Windows 10中运行logstash
C:>c:logstashbinlogstash.bat -f c:logstashconfiglogs-pipeline.conf
和
JAVA_HOME = C:Program FilesJavajdk-15.0.2
我安装jdbc与这篇文章
binlogstash-plugin.bat install logstash-output-jdbc
得到错误
Using JAVA_HOME defined java: C:Program FilesJavajdk-15.0.2
WARNING, using JAVA_HOME while Logstash distribution comes with a bundled JDK
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
logs-pipeline.conf:
input{
rabbitmq {
host => "127.0.0.1"
subscription_retry_interval_seconds => 90
queue => "TestQueue"
threads => 2
passive => true
codec => "json"
}
}
output {
jdbc{
driver_jar_path => "C:sqljdbc_6.0enujre8sqljdbc42.jar"
connection_string => "jdbc:sqlserver://localhost:1433;databaseName=tdfgdfgest;integratedSecurity=true"
statement => [ "INSERT into DB.TMP.samsamt (w, test1, test2, kkk) VALUES(?,?,?,?)", "client_num", "consignee_name", "@timestamp","host" ]
}
}
logstash.bat jvm.options
我能做什么?
Logstash不支持Java 15。
你需要使用一个支持的版本
Logstash需要以下版本之一:
Java 8
Java 11
Java 14
Jdk 15不支持ConcMarkSweepGC
GC
JDK 15 removed support for the CMS-related flags..
from JDK description
您的脚本logstash.bat有链接到文件jvm。选项,还有下一个设置:
## GC configuration
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
删除这些字符串并尝试运行。