logstash jdbc mysql,用于MYSQL的Logstash Jdbc输入插件

I am using Logstash in windows. i was not able to install input jdbc plug so i downloaded the zip file manually and place the logstash folder from plugin in to my logstash-1.5.2 folder.

the folder structure- "D:\elastic search\logstash-1.5.2\lib\logstash\inputs\jdbc.rb".

my conf file

input {

jdbc {

jdbc_driver_library => "D:/elastic search/logstash-1.5.2/lib/mysql-connector-java-5.1.13-bin.jar"

jdbc_driver_class => "com.mysql.jdbc.Driver"

jdbc_connection_string => "jdbc:mysql://localhost:3306/test"

jdbc_user => "root"

jdbc_password => ""

statement => "SELECT * from data"

jdbc_paging_enabled => "true"

jdbc_page_size => "50000"

}

}

output {

stdout { codec => rubydebug }

elasticsearch {

embedded => true

index => "bike"

type => "bikeapp"

cluster =>"trailcluster"

protocol => "http"

port => "9200"

}

}

when i run the logstash i get the error

D:\elastic search\logstash-1.5.2\bin>logstash -f logtest.conf

io/console not supported; tty will not be manipulated

←[33mjdbc plugin doesn't have a version. This plugin isn't well

supported by the community and likely has no maintainer. {:level=>:warn}←[0m

←[33mYou are using a deprecated config setting "type" set in elasticsearch. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. You can achieve this same behavior with the new

conditionals, like: `if [type] == "sometype" { elasticsearch { ... } }`. If you have any questions about this, please visit the #logstash channel on freenode irc. {:name=>"type", :plugin=><:outputs::elasticsearch>

->, :level=>:warn}←[0m

LoadError: no such file to load -- sequel

require at org/jruby/RubyKernel.java:1072

require at D:/elastic search/logstash-1.5.2/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb:65

prepare_jdbc_connection at D:/elastic search/logstash-1.5.2/lib/logstash/plugin_mixins/jdbc.rb:65

register at D:/elastic search/logstash-1.5.2/lib/logstash/inputs/jdbc.rb:144

start_inputs at D:/elastic search/logstash-1.5.2/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb:148

each at org/jruby/RubyArray.java:1613

start_inputs at D:/elastic search/logstash-1.5.2/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb:147

run at D:/elastic search/logstash-1.5.2/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb:80

synchronize at org/jruby/ext/thread/Mutex.java:149

run at D:/elastic search/logstash-1.5.2/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb:80

execute at D:/elastic search/logstash-1.5.2/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/agent.rb:150

run at D:/elastic search/logstash-1.5.2/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/runner.rb:91

call at org/jruby/RubyProc.java:271

run at D:/elastic search/logstash-1.5.2/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/runner.rb:96

call at org/jruby/RubyProc.java:271

initialize at D:/elastic search/logstash-1.5.2/vendor/bundle/jruby/1.9/gems/stud-0.0.20/lib/stud/task.rb:12

解决方案

After adding the Jar file to Plugin fodler,You just goto the folder path in CMD Prompt and install the plugin using below commands to logstash

Run in an installed Logstash :

Build your plugin gem

gem build logstash-input-jdbc.gemspec

Install the plugin from the Logstash home

bin/plugin install /your/local/plugin/logstash-input-jdbc.gem

Finally you will, Start Logstash and proceed to test the plugin using the configuration you are using....

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值