elk系列教程:logstash报错处理

  • 2019-07-30
  • 0
  • 0

com.mysql.jdbc.Driver not loaded. Are you sure you’ve included the correct jdbc driver in :jdbc_driver_library?

巨坑的一个问题,困扰了我一个多礼拜。今天才发现是驱动包不对导致的,一直都以为是docker的路径问题,各种查问题。

错误信息:

[2019-07-30T09:22:00,865][ERROR][logstash.inputs.jdbc     ] Failed to load ./mysql-connector-java-5.1.47.jar {:exception=>#<TypeError: failed to coerce jdk.internal.loader.ClassLoaders$AppClassLoader to java.net.URLClassLoader>}
{ 2016 rufus-scheduler intercepted an error:
  2016   job:
  2016     Rufus::Scheduler::CronJob "* * * * *" {}
  2016   error:
  2016     2016
  2016     LogStash::ConfigurationError
  2016     com.mysql.jdbc.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?
  2016       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:163:in `open_jdbc_connection'
  2016       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:221:in `execute_statement'
  2016       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:in `execute_query'
  2016       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:258:in `block in run'
  2016       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:234:in `do_call'
  2016       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:258:in `do_trigger'
  2016       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:300:in `block in start_work_thread'
  2016       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:299:in `block in start_work_thread'
  2016       org/jruby/RubyKernel.java:1425:in `loop'
  2016       /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:289:in `block in start_work_thread'
  2016   tz:
  2016     ENV['TZ']: 
  2016     Time.now: 2019-07-30 09:22:00 UTC
  2016   scheduler:
  2016     object_id: 2006
  2016     opts:
  2016       {:max_work_threads=>1}
  2016       frequency: 0.3
  2016       scheduler_lock: #<Rufus::Scheduler::NullLock:0x154e31c4>
  2016       trigger_lock: #<Rufus::Scheduler::NullLock:0x174acfce>
  2016     uptime: 21.659418 (21s661)
  2016     down?: false
  2016     threads: 2
  2016       thread: #<Thread:0x3cc4aa81>
  2016       thread_key: rufus_scheduler_2006
  2016       work_threads: 1
  2016         active: 1
  2016         vacant: 0
  2016         max_work_threads: 1
  2016       mutexes: {}
  2016     jobs: 1
  2016       at_jobs: 0
  2016       in_jobs: 0
  2016       every_jobs: 0
  2016       interval_jobs: 0
  2016       cron_jobs: 1
  2016     running_jobs: 1
  2016     work_queue: 0
} 2016 .

后面发现,是我的驱动包引用错误,并不是路径映射的问题,还是得认真一点啊,这么的破问题,搞了这么久

评论

还没有任何评论,你来说两句吧

你必须 登录 才能发表评论.