logstash “管道操作::创建”的Java::JavaLang::非法状态异常< main>

kd3sttzy  于 2022-12-16  发布在  Logstash
关注(0)|答案(1)|浏览(380)

我一直试图从logstash.yml文件运行一个非常简单的SQL查询,并对AWS opensearch进行查询。
logstash.yml文件:

input {
    jdbc {
            jdbc_connection_string => "jdbc:postgresql://abcxyz.ap-south-1.rds.amazonaws.com:5432/k***"
            jdbc_user => "k***"
            jdbc_password => "p**********s"
            jdbc_driver_library => "/path/to/postgresql-42.3.0.jar"
            jdbc_driver_class => "org.postgresql.Driver"
            jdbc_paging_enabled => true
            tracking_column => "unix_ts_in_secs"
            use_column_value => true
            tracking_column_type => "numeric"
            schedule => "*/5 * * * * *"

            statement => 'SELECT name FROM "User_profile"'
            # statement => 'SELECT * FROM "Video_Videos"'
    }
}
filter {
    mutate {
        copy => { "id" => "[@metadata][_id]"}
        remove_field => ["id", "@version", "unix_ts_in_secs"]
    }
}
output {
    opensearch {
            hosts => "https://xyz.ap-south-1.es.amazonaws.com:443"
            user => "k**h"
            password => "E****"
            index => "rdbms_sync_idx"
            document_id => "%{[@metadata][_id]}"
            ssl => true
            ssl_certificate_verification => false
    }
}

但每当我想逃跑的时候./logstash -f /etc/logstash/conf.d/cp_logstash.yml从我的命令终端
我得到了以下错误跟踪[更新]:

Using bundled JDK: /usr/share/logstash/jdk
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console
[INFO ] 2021-12-24 04:19:02.723 [main] runner - Starting Logstash {"logstash.version"=>"7.16.1", "jruby.version"=>"jruby 9.2.20.1 (2.5.8) 2021-11-30 2a2962fbd1 OpenJDK 64-Bit Server VM 11.0.13+8 on 11.0.13+8 +indy +jit [linux-x86_64]"}
[WARN ] 2021-12-24 04:19:03.460 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified
[FATAL] 2021-12-24 04:19:03.484 [LogStash::Runner] runner - Logstash could not be started because there is already another instance using the configured data directory.  If you wish to run multiple instances, you must change the "path.data" setting.
[FATAL] 2021-12-24 04:19:03.487 [LogStash::Runner] 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.20.1.jar:?]
    at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.20.1.jar:?]
    at usr.share.logstash.lib.bootstrap.environment.<main>(/usr/share/logstash/lib/bootstrap/environment.rb:94) ~[?:?]

不确定如何修复这些错误。有什么建议吗?
谢谢,

5m1hhzi4

5m1hhzi41#

这一行提到了这个问题:
无法启动Logstash,因为已经有另一个示例使用配置的数据目录。如果要运行多个示例,必须更改“path.data“设置。
这意味着您正在同一台主机上运行另一个Logstash示例,该示例共享同一个数据目录,这是不允许的。
只需确保每个示例在其各自的配置中具有不同的path.data设置。

相关问题