logstash 插件安装


logstash官方提供的插件安装方法是:

bin/plugin install logstash-output-webhdfs

按照此方法,不出意料肯定会出现以下错误:

[ec2-user@ip-xxx-xxx-xxx-xxx logstash-2.3.0]$ bin/plugin install --no-verify logstash-output-webhdfs The use of bin/plugin is deprecated and will be removed in a feature release. Please use bin/logstash-plugin. Installing logstash-output-webhdfs Error Bundler::InstallError, retrying 1/10 An error occurred while installing snappy (0.0.12), and Bundler cannot continue. Make sure that `gem install snappy -v '0.0.12'` succeeds before bundling. WARNING: SSLSocket#session= is not supported WARNING: SSLSocket#session= is not supported WARNING: SSLSocket#session= is not supported 

原因是:GFW墙掉了logstash的默认gem source(类似于CentOS的yum source);

[ec2-user@ip-xxx-xxx-xxx-xxx logstash-2.3.0]$ cat Gemfile | grep source
source "https://rubygems.org"

需要将gem source修改为国内的源,

[ec2-user@ip-xxx-xxx-xxx-xxx logstash-2.3.0]$ vim Gemfile # This is a Logstash generated Gemfile. # If you modify this file manually all comments and formatting will be lost. #source "https://rubygems.org" source "https://ruby.taobao.org/" ...... 

执行

bin/plugin install logstash-output-webhdfs

一般都能安装成。


有的插件在淘宝的gem库中找不到,这时候可以考虑本地安装的办法。
先去https://github.com/logstash-plugins下载对应的插件,然后解压,在logstash的Gemfile中添加一行(以logstash-output-webhdfs为例):

[ec2-user@ip-xxx-xxx-xxx-xxx logstash-2.3.0]$ vim Gemfile ...... gem "logstash-output-webhdfs", :path => "/home/ec2-user/logstash-output-webhdfs" 

执行

bin/logstash-plugin install --no-verify

即可安装成功



作者:studyz
链接:https://www.jianshu.com/p/4fe495639a9a
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM