报错信息
[2019-07-19T17:00:00,134][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"TypeError: could not coerce Fixnum to class java.lang.String"}
{ 2014 rufus-scheduler intercepted an error:
2014 job:
2014 Rufus::Scheduler::CronJob "* * * * *" {}
2014 error:
2014 2014
2014 Sequel::DatabaseConnectionError
2014 TypeError: could not coerce Fixnum to class java.lang.String
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/adapters/jdbc.rb:199:in `connect'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool.rb:126:in `make_new'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool/threaded.rb:192:in `assign_connection'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool/threaded.rb:133:in `acquire'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool/threaded.rb:90:in `hold'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/database/connecting.rb:269:in `synchronize'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/database/connecting.rb:279:in `test_connection'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/database/connecting.rb:58:in `connect'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/core.rb:116:in `connect'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/plugin_mixins/jdbc.rb:112:in `block in jdbc_connect'
2014 org/jruby/RubyKernel.java:1292:in `loop'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/plugin_mixins/jdbc.rb:109:in `jdbc_connect'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/plugin_mixins/jdbc.rb:161:in `open_jdbc_connection'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/plugin_mixins/jdbc.rb:227:in `execute_statement'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/inputs/jdbc.rb:271:in `execute_query'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.3/lib/logstash/inputs/jdbc.rb:250:in `block in run'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:234:in `do_call'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:258:in `do_trigger'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:300:in `block in start_work_thread'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:299:in `block in start_work_thread'
2014 org/jruby/RubyKernel.java:1292:in `loop'
2014 D:/ElasticSearch01/logstash-6.2.1/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:289:in `block in start_work_thread'
问题原因: 连接数据库密码没有加引号(学成在线视频中没有加所以我也没加)
解决办法: 加上引号