logstash6.6.0-6.6.2版本使用jdbc input plugin时如果设置了jdbc_default_timezone,会报错:
{ 2012 rufus-scheduler intercepted an error: 2012 job: 2012 Rufus::Scheduler::CronJob "* * * * *" {} 2012 error: 2012 2012 2012 NoMethodError 2012 undefined method `utc_total_offset_rational' for #<TZInfo::TransitionsTimezonePeriod:0x78b60bbe> Did you mean? utc_total_offset 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/extensions/named_timezones.rb:81:in `convert_output_datetime_other' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/timezones.rb:54:in `convert_output_timestamp' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/database/misc.rb:219:in `from_application_timestamp' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1058:in `format_timestamp' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1226:in `literal_datetime' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1231:in `literal_datetime_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:105:in `literal_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:602:in `placeholder_literal_string_sql_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/sql.rb:112:in `to_s_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1236:in `literal_expression_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:89:in `literal_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1571:in `static_sql' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:236:in `select_sql' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:147:in `sql' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1585:in `subselect_sql_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1211:in `literal_dataset_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:109:in `literal_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:271:in `aliased_expression_sql_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/sql.rb:112:in `to_s_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1236:in `literal_expression_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:89:in `literal_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1104:in `identifier_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1114:in `block in identifier_list_append' 2012 org/jruby/RubyArray.java:1734:in `each' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1112:in `identifier_list_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1542:in `source_list_append' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:1395:in `select_from_sql' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/sql.rb:244:in `select_sql' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/actions.rb:729:in `single_value!' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/dataset/actions.rb:110:in `count' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.17.0/lib/sequel/extensions/pagination.rb:58:in `each_page' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:251:in `perform_query' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:229:in `execute_statement' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:in `execute_query' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:258:in `block in run' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:234:in `do_call' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:258:in `do_trigger' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:300:in `block in start_work_thread' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:299:in `block in start_work_thread' 2012 org/jruby/RubyKernel.java:1292:in `loop' 2012 /data/logstash-6.6.2/vendor/bundle/jruby/2.3.0/gems/rufus-scheduler-3.0.9/lib/rufus/scheduler/jobs.rb:289:in `block in start_work_thread' 2012 tz: 2012 ENV['TZ']: 2012 Time.now: 2019-03-22 11:23:04 +0800 2012 scheduler: 2012 object_id: 2010 2012 opts: 2012 {:max_work_threads=>1} 2012 frequency: 0.3 2012 scheduler_lock: #<Rufus::Scheduler::NullLock:0x17bfc482> 2012 trigger_lock: #<Rufus::Scheduler::NullLock:0x6b986244> 2012 uptime: 63.011622 (1m3s13) 2012 down?: false 2012 threads: 2 2012 thread: #<Thread:0x5aaa15f6> 2012 thread_key: rufus_scheduler_2010 2012 work_threads: 1 2012 active: 1 2012 vacant: 0 2012 max_work_threads: 1 2012 mutexes: {} 2012 jobs: 1 2012 at_jobs: 0 2012 in_jobs: 0 2012 every_jobs: 0 2012 interval_jobs: 0 2012 cron_jobs: 1 2012 running_jobs: 1 2012 work_queue: 0
这个bug是由于升级zinfo1.2.5->2.0.0导致的
$LOGSTASH_HOME/vendor/bundle/jruby/2.3.0/gems/tzinfo-2.0.0
预计会在下个版本修复,只能先降级到6.5.4版本;
参考:
https://github.com/logstash-plugins/logstash-input-jdbc/issues/325