【问题标题】:Error : Logstash stopped processing because of an error: (SystemExit) exit错误:Logstash 因错误停止处理:(SystemExit)退出
【发布时间】:2021-05-27 22:15:23
【问题描述】:

我正在尝试使用 LogStash 将 SQL Server 数据复制到 Elasticsearch,实现我自己的名为 sql.conf

的配置脚本

我收到以下错误:

WARNING, using JAVA_HOME while Logstash distribution comes with a bundled JDK
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Sending Logstash logs to C:/Program Files/Elastic/logstash-7.11.1/logs which is now configured via log4j2.properties
[2021-02-25T14:57:05,899][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"7.11.1", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 11.0.10+8-LTS-162 on 11.0.10+8-LTS-162 +indy +jit [mswin32-x86_64]"}
[2021-02-25T14:57:06,132][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2021-02-25T14:57:06,858][INFO ][logstash.config.source.local.configpathloader] No config files found in path {:path=>"C:/Program Files/Elastic/logstash-7.11.1/sql.conf"}
[2021-02-25T14:57:07,136][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.
[2021-02-25T14:57:07,747][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}
[2021-02-25T14:57:12,678][INFO ][logstash.runner          ] Logstash shut down.
[2021-02-25T14:57:12,968][FATAL][org.logstash.Logstash    ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.13.0.jar:?]
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.13.0.jar:?]
        at C_3a_.Program_20_Files.Elastic.logstash_minus_7_dot_11_dot_1.lib.bootstrap.environment.<main>(C:\Program Files\Elastic\logstash-7.11.1\lib\bootstrap\environment.rb:89) ~[?:?]

这是我的 sql.conf

input {
  jdbc {
    jdbc_connection_string => "jdbc:sqlserver://localhost;databaseName=XXX;integratedSecurity=true;"
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    jdbc_user => "XXX"

    statement => "SELECT * FROM XXX"
  }
}

output {
  elasticsearch {
    hosts => ["localhost:9200"]
    index => "cs_XXX"
  }
}

这里是 logstash.conf

input {
  beats {
   port => 5044
   type => "log"
  }
}

output {
  elasticsearch {
    hosts => "localhost:9200"
    manage_template => false
    index => "%{[@metadata][beat]}-%{+yyyy.ww}"
    document_type => "%{[@metadata][type]}"
  }
}

使用的命令行:

bin\logstash -f sql.conf

或

bin\logstash

两个cmd都报同样的错误

【问题讨论】:

    标签: elasticsearch jdbc logstash


    【解决方案1】:

    我通过更改 cmd 行中的路径来解决问题

    bin\logstash -f sql.conf 
    

    到

    bin\logstash -f .\config\sql.conf
    

    【讨论】:

      【解决方案2】:

      [logstash.config.source.local.configpathloader] 在路径 {:path=>"C:/Program Files/Elastic/logstash-7.11.1/sql.conf"} 中找不到配置文件}

      您为 -f 使用了相对路径,因此它正在当前目录中查找它。它没有找到它。给出正确的相对路径或绝对路径。

      【讨论】:

        【解决方案3】:

        您好,请重新检查配置文件的名称。 就我而言,我收到错误,因为名称是 logstash.conf.conf 然后我把它改成了logstash.conf

        【讨论】:

        • 这应该是评论而不是答案。
        猜你喜欢
        • 2020-12-26
        • 2020-02-03
        • 2023-03-08
        • 1970-01-01
        • 1970-01-01
        • 2020-06-24
        • 2016-12-08
        • 2023-04-06
        • 1970-01-01
        相关资源
        最近更新 更多