我正在与elasticsearch一起使用,即时通讯也试图通过logstash将mysql与elasticsearch连接起来。我创建了配置文件,当我运行它时,出现以下错误
Bundler::GemNotFound: Could not find logstash-input-jdbc-4.2.1 in any of the sources
materialize at C:/Users/esmer/E/ELK/logstash-5.5.1/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/spec_set.rb:92
map! at org/jruby/RubyArray.java:2446
materialize at C:/Users/esmer/E/ELK/logstash-5.5.1/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/spec_set.rb:85
specs at C:/Users/esmer/E/ELK/logstash-5.5.1/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:132
specs_for at C:/Users/esmer/E/ELK/logstash-5.5.1/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:177
requested_specs at C:/Users/esmer/E/ELK/logstash-5.5.1/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:166
requested_specs at C:/Users/esmer/E/ELK/logstash-5.5.1/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/environment.rb:18
setup at C:/Users/esmer/E/ELK/logstash-5.5.1/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/runtime.rb:13
setup at C:/Users/esmer/E/ELK/logstash-5.5.1/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler.rb:122
setup! at C:/Users/esmer/E/ELK/logstash-5.5.1/lib/bootstrap/bundler.rb:67
(root) at C:\Users\esmer\E\ELK\logstash-5.5.1\lib\bootstrap\environment.rb:67code here
配置文件的代码如下:
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:80/temperature"
jdbc_user => "admin1"
jdbc_password => ""
jdbc_driver_library => "c:\e\elk\logstash-5.5.1\lib\mysql-connector-java-5.1.43-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM temperature"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
}
}
output {
stdout {codec => rubydebug}
elasticsearch {
hosts => "localhost:9200"
index => "temperature"
document_type => "data"
}
}
gem 文件:
# This is a Logstash generated Gemfile.
# If you modify this file manually all comments and formatting will be lost.
source "https://rubygems.org"
gem "logstash-core", :path => "./logstash-core"
gem "logstash-core-plugin-api", :path => "./logstash-core-plugin-api"
gem "paquet", "~> 0.2.0"
gem "ruby-progressbar", "~> 1.8.1"
gem "builder", "~> 3.2.2"
gem "file-dependencies", "0.1.6"
gem "ci_reporter_rspec", "1.0.0", :group => :development
gem "simplecov", :group => :development
gem "tins", "1.6", :group => :development
gem "rspec", "~> 3.1.0", :group => :development
gem "logstash-devutils", :group => :development
gem "benchmark-ips", :group => :development
gem "octokit", "3.8.0", :group => :build
gem "stud", "~> 0.0.22", :group => :build
gem "fpm", "~> 1.3.3", :group => :build
gem "rubyzip", "~> 1.1.7", :group => :build
gem "gems", "~> 0.8.3", :group => :build
gem "rack", "1.6.6"
gem "rack-test", :require => "rack/test", :group => :development
gem "flores", "~> 0.0.6", :group => :development
gem "term-ansicolor", "~> 1.3.2", :group => :development
gem "docker-api", "1.31.0", :group => :development
gem "rest-client", "1.8.0", :group => :development
gem "pleaserun", "~>0.0.28"
gem "logstash-input-heartbeat"
gem "logstash-codec-collectd"
gem "logstash-output-xmpp"
gem "logstash-codec-cef"
gem "logstash-codec-dots"
gem "logstash-codec-edn"
gem "logstash-codec-edn_lines"
gem "logstash-codec-fluent"
gem "logstash-codec-es_bulk"
gem "logstash-codec-graphite"
gem "logstash-codec-json"
gem "logstash-codec-json_lines"
gem "logstash-codec-line"
gem "logstash-codec-msgpack"
gem "logstash-codec-multiline"
gem "logstash-codec-netflow", "~> 3.4.0"
gem "logstash-codec-plain"
gem "logstash-codec-rubydebug"
gem "logstash-filter-clone"
gem "logstash-filter-csv"
gem "logstash-filter-date"
gem "logstash-filter-dns"
gem "logstash-filter-drop"
gem "logstash-filter-fingerprint"
gem "logstash-filter-geoip", "~> 4.2.0"
gem "logstash-filter-grok"
gem "logstash-filter-json"
gem "logstash-filter-kv"
gem "logstash-filter-metrics"
gem "logstash-filter-mutate"
gem "logstash-filter-ruby"
gem "logstash-filter-sleep"
gem "logstash-filter-split"
gem "logstash-filter-syslog_pri"
gem "logstash-filter-throttle"
gem "logstash-filter-urldecode"
gem "logstash-filter-useragent", "~> 3.1.0"
gem "logstash-filter-uuid"
gem "logstash-filter-xml"
gem "logstash-input-couchdb_changes"
gem "logstash-input-elasticsearch"
gem "logstash-input-exec"
gem "logstash-input-file"
gem "logstash-input-ganglia"
gem "logstash-input-gelf"
gem "logstash-input-generator"
gem "logstash-input-graphite"
gem "logstash-input-http"
gem "logstash-input-http_poller"
gem "logstash-input-imap"
gem "logstash-input-irc"
gem "logstash-input-jdbc"
gem "logstash-input-log4j"
gem "logstash-input-lumberjack"
gem "logstash-input-pipe"
gem "logstash-input-rabbitmq"
gem "logstash-input-redis"
gem "logstash-input-s3"
gem "logstash-input-snmptrap"
gem "logstash-input-sqs"
gem "logstash-input-stdin"
gem "logstash-input-syslog"
gem "logstash-input-tcp", "~> 4.1.0"
gem "logstash-input-twitter"
gem "logstash-input-udp"
gem "logstash-input-unix"
gem "logstash-input-xmpp"
gem "logstash-input-kafka", "~> 5"
gem "logstash-input-beats", "~> 3.0", ">= 3.1.18"
gem "logstash-output-cloudwatch"
gem "logstash-output-csv"
gem "logstash-output-elasticsearch"
gem "logstash-output-file"
gem "logstash-output-graphite"
gem "logstash-output-http"
gem "logstash-output-irc"
gem "logstash-output-kafka", "~> 5"
gem "logstash-output-nagios"
gem "logstash-output-null"
gem "logstash-output-pagerduty"
gem "logstash-output-pipe"
gem "logstash-output-rabbitmq"
gem "logstash-output-redis"
gem "logstash-output-s3"
gem "logstash-output-sns"
gem "logstash-output-sqs"
gem "logstash-output-statsd"
gem "logstash-output-stdout"
gem "logstash-output-tcp"
gem "logstash-output-udp"
gem "logstash-output-webhdfs"
gem "logstash-filter-dissect"
gem "logstash-input-dead_letter_queue"
我试过bundle install,也尝试更改PATH,但它无法将其识别为内部变量,不知道如何解决。
有什么建议么 ?
谢谢。
最佳答案
首先,您必须运行以下命令安装logstash输入插件
而且如果没有帮助,
尝试
而不是
用于jdbc_driver_class。当我不使用oracle时,我也遇到了同样的问题
在oracle.jdbc.OracleDriver之前作为jdbc_driver_class。
关于mysql - Bundler::GemNotFound:在任何来源9(logstash,elasticsearch)中都找不到logstash-input-jdbc-4.2.1,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45486731/