logstach启动成功,但是同步mysql数据出错

小编遇到这个问题开始时候也是困惑了很两天,最后无意中想的可能是java驱动的问题。

错误原因:Unable to connect to database. Tried 1 times {:error_message=>“Java::JavaSql::SQLException: The server time zone value ‘脰脨鹿煤卤锚脳录脢卤录盲’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.”}
简单意思:不能连接的数据库,服务器 的时区没办法识别,因为返回的是多个,所以你要么配置mysql数据库或者是你的mysql连接。
解决方法:因为我用的是mysql的最新的驱动8.多的版本,所以配置数据库的url时候一定要把serverTimezone=UTC天加上。

jdbc_connection_string => "jdbc:mysql://localhost:3306/springboot?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true"

 错误信息:
    [ERROR][logstash.inputs.jdbc     ] Unable to connect to database. Tried 1 times {:error_message=>"Java::JavaSql::SQLException: The server time zone value '脰脨鹿煤卤锚脳录脢卤录盲' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support."}
    { 2010 rufus-scheduler intercepted an error:
      2010   job:
      2010     Rufus::Scheduler::CronJob "* * * * *" {}
      2010   error:
      2010     2010
      2010     Sequel::DatabaseConnectionError
      2010     Java::JavaSql::SQLException: The server time zone value '???ú±ê×??±??' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
      2010       com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(com/mysql/cj/jdbc/exceptions/SQLError.java:129)
      2010       com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(com/mysql/cj/jdbc/exceptions/SQLError.java:97)
      2010       com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(com/mysql/cj/jdbc/exceptions/SQLError.java:89)
      2010       com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(com/mysql/cj/jdbc/exceptions/SQLError.java:63)
      2010       com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(com/mysql/cj/jdbc/exceptions/SQLError.java:73)
      2010       com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(com/mysql/cj/jdbc/exceptions/SQLExceptionsMapping.java:76)
      2010       com.mysql.cj.jdbc.ConnectionImpl.createNewIO(com/mysql/cj/jdbc/ConnectionImpl.java:832)
      2010       com.mysql.cj.jdbc.ConnectionImpl.<init>(com/mysql/cj/jdbc/ConnectionImpl.java:456)
      2010       com.mysql.cj.jdbc.ConnectionImpl.getInstance(com/mysql/cj/jdbc/ConnectionImpl.java:240)
      2010       com.mysql.cj.jdbc.NonRegisteringDriver.connect(com/mysql/cj/jdbc/NonRegisteringDriver.java:207)
      2010       java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
      2010       org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:423)
      2010       org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:290)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.adapters.jdbc.connect(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/adapters/jdbc.rb:215)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.adapters.jdbc.RUBY$method$connect$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/sequel_minus_5_dot_14_dot_0/lib/sequel/adapters/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/adapters/jdbc.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.connection_pool.make_new(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/connection_pool.rb:127)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.connection_pool.RUBY$method$make_new$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/sequel_minus_5_dot_14_dot_0/lib/sequel/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/connection_pool.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.connection_pool.threaded.assign_connection(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/connection_pool/threaded.rb:206)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.connection_pool.threaded.RUBY$method$assign_connection$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/sequel_minus_5_dot_14_dot_0/lib/sequel/connection_pool/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/connection_pool/threaded.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.connection_pool.threaded.acquire(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/connection_pool/threaded.rb:138)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.connection_pool.threaded.RUBY$method$acquire$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/sequel_minus_5_dot_14_dot_0/lib/sequel/connection_pool/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/connection_pool/threaded.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.connection_pool.threaded.hold(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/connection_pool/threaded.rb:90)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.database.connecting.synchronize(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/database/connecting.rb:270)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.database.connecting.test_connection(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/database/connecting.rb:279)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.database.connecting.connect(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/database/connecting.rb:58)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_14_dot_0.lib.sequel.core.connect(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.14.0/lib/sequel/core.rb:121)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.plugin_mixins.jdbc.jdbc.block in jdbc_connect(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:115)
      2010       org.jruby.RubyKernel.loop(org/jruby/RubyKernel.java:1292)
      2010       org.jruby.RubyKernel$INVOKER$s$0$0$loop.call(org/jruby/RubyKernel$INVOKER$s$0$0$loop.gen)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.plugin_mixins.jdbc.jdbc.jdbc_connect(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:112)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.plugin_mixins.jdbc.jdbc.RUBY$method$jdbc_connect$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13/lib/logstash/plugin_mixins/jdbc/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.plugin_mixins.jdbc.jdbc.open_jdbc_connection(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:165)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.plugin_mixins.jdbc.jdbc.RUBY$method$open_jdbc_connection$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13/lib/logstash/plugin_mixins/jdbc/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.plugin_mixins.jdbc.jdbc.execute_statement(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:221)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.plugin_mixins.jdbc.jdbc.RUBY$method$execute_statement$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13/lib/logstash/plugin_mixins/jdbc/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.inputs.jdbc.execute_query(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.inputs.jdbc.RUBY$method$execute_query$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13/lib/logstash/inputs/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.logstash_minus_input_minus_jdbc_minus_4_dot_3_dot_13.lib.logstash.inputs.jdbc.block in run(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:258)
      2010       org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)
      2010       org.jruby.RubyProc.call19(org/jruby/RubyProc.java:273)
      2010       org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.rufus_minus_scheduler_minus_3_dot_0_dot_9.lib.rufus.scheduler.jobs.do_call(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:234)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.rufus_minus_scheduler_minus_3_dot_0_dot_9.lib.rufus.scheduler.jobs.RUBY$method$do_call$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/rufus_minus_scheduler_minus_3_dot_0_dot_9/lib/rufus/scheduler/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.rufus_minus_scheduler_minus_3_dot_0_dot_9.lib.rufus.scheduler.jobs.do_trigger(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:258)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.rufus_minus_scheduler_minus_3_dot_0_dot_9.lib.rufus.scheduler.jobs.RUBY$method$do_trigger$0$__VARARGS__(D_3a_/$1_minus_search/logstash_minus_6_dot_5_dot_4/vendor/bundle/jruby/$2_dot_3_dot_0/gems/rufus_minus_scheduler_minus_3_dot_0_dot_9/lib/rufus/scheduler/D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.rufus_minus_scheduler_minus_3_dot_0_dot_9.lib.rufus.scheduler.jobs.block in start_work_thread(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:300)
      2010       org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)
      2010       org.jruby.RubyProc.call19(org/jruby/RubyProc.java:273)
      2010       org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.rufus_minus_scheduler_minus_3_dot_0_dot_9.lib.rufus.scheduler.jobs.block in start_work_thread(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:299)
      2010       org.jruby.RubyKernel.loop(org/jruby/RubyKernel.java:1292)
      2010       org.jruby.RubyKernel$INVOKER$s$0$0$loop.call(org/jruby/RubyKernel$INVOKER$s$0$0$loop.gen)
      2010       D_3a_.$1_minus_search.logstash_minus_6_dot_5_dot_4.vendor.bundle.jruby.$2_dot_3_dot_0.gems.rufus_minus_scheduler_minus_3_dot_0_dot_9.lib.rufus.scheduler.jobs.block in start_work_thread(D:/1-search/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:289)
      2010       org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)
      2010       org.jruby.RubyProc.call(org/jruby/RubyProc.java:246)
      2010       java.lang.Thread.run(java/lang/Thread.java:745)
      2010   tz:
      2010     ENV['TZ']:
      2010     Time.now: 2018-12-26 13:52:01 +0800
      2010   scheduler:
      2010     object_id: 2008
      2010     opts:
      2010       {:max_work_threads=>1}
      2010       frequency: 0.3
      2010       scheduler_lock: #<Rufus::Scheduler::NullLock:0x31ab8b6a>
      2010       trigger_lock: #<Rufus::Scheduler::NullLock:0x64c961ed>
      2010     uptime: 27.616 (27s615)
      2010     down?: false
      2010     threads: 2
      2010       thread: #<Thread:0x59a7c09c>
      2010       thread_key: rufus_scheduler_2008
      2010       work_threads: 1
      2010         active: 1
      2010         vacant: 0
      2010         max_work_threads: 1
      2010       mutexes: {}
      2010     jobs: 1
      2010       at_jobs: 0
      2010       in_jobs: 0
      2010       every_jobs: 0
      2010       interval_jobs: 0
      2010       cron_jobs: 1
      2010     running_jobs: 1
      2010     work_queue: 0
    } 2010 .
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页