logstash启动了 mysql无法连接

报错信息

[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'

问题原因: 连接数据库密码没有加引号(学成在线视频中没有加所以我也没加)

在这里插入图片描述


解决办法: 加上引号

在这里插入图片描述

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值