如何解决logstash与aws postgres的连接问题?

oxiaedzo  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(0)|浏览(278)

我有一个postgres数据库rds,我需要通过jdbc输入使用logstash来查询它。我尝试了大多数解决方案,例如添加usessl=false等,但似乎有一个问题。尽管如此,日志的信息量还是不那么丰富,“可能是坏的jdbc字符串”:
错误:sequel::databaseerror:driver.new.connect返回nil:可能是错误的jdbc连接字符串异常:sequel::databaseconnectionerror堆栈:/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.35.0/lib/sequel/adapters/jdbc.rb:228:in connect' /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.35.0/lib/sequel/connection_pool.rb:122:in 新建'/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.35.0/lib/sequel/connection\u pool/threaded.rb:209:in assign_connection' /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.35.0/lib/sequel/connection_pool/threaded.rb:139:in 获取'/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.35.0/lib/sequel/connection\u pool/threaded.rb:91:in hold' /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.35.0/lib/sequel/database/connecting.rb:270:in 同步'/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.35.0/lib/sequel/database/connecting.rb:279:in test_connection' /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.35.0/lib/sequel/database/connecting.rb:58:in connect'/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.35.0/lib/sequel/core.rb:125:in connect' /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.0.6/lib/logstash/plugin_mixins/jdbc/jdbc.rb:114:in 块在jdbc\u connect'
下面是我用来连接的.conf文件:

input {
    jdbc {
        jdbc_connection_string => "jdbc:psql://domain.xxxxxx.us-east-1.rds.amazonaws.com:5432/dbtest?useSSL=true"
        jdbc_user => "USERNAME"
        jdbc_password => "PASSWORD"
        jdbc_driver_library => "path/to/postgresql-42.2.16.jar"
        jdbc_driver_class => "org.postgresql.Driver"
        statement => "SELECT * from dbtableX"
    }
}
output {
    stdout { codec => json_lines }
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题