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

即可安装成功

推荐阅读更多精彩内容

  • 离线安装 下载插件包: 例如需要下载exec包,在github网站 https://github.com/logs...
    gaodong阅读 729评论 0 0
  • 概述 监控预警平台, eagle + eye (鹰眼)的合体词, 寓意可以快速发现问题, 并及时作出响应,Eagl...
    Kungfu猫熊阅读 6,623评论 0 52
  • Linux-Server-Notes PMS /home/softwareluke/图片/2017-09-11 0...
    燕京教育阅读 423评论 0 1
  • ELK已经升级到6了,希望使用6的同学,可以查看Ken同学的这篇文章 参考:ELK部署详解centos7虚拟机安装...
    slowrabbit阅读 1,434评论 2 7
  • 无言花 春去夏至,秋来冬往。一年又一年,时光不待我。 当年离别时,话犹存,如今,徒留满地枯叶。 桃花已开,不复见笑...
    林小希阅读 438评论 0 2
  • 我家在川北嘉陵江畔一个名叫竹山观的小村庄,打我记事起,院子后面就有一个占地数亩的橙子园。听爷爷说,那些橙子树是我们...
    李茗阅读 936评论 21 17