14
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

fluent-plugin-forestが見つからない!

Last updated at Posted at 2015-09-04
この記事の内容はAmazonLinux2015.03で実行しました。

コメント頂きましたように、どうやらtd-agent-gem使えば良かったようでした。
http://docs.fluentd.org/articles/faq#i-installed-td-agent-and-want-to-add-custom-plugins-how-do-i-do-it
td-agent2から変更されていたんですね。
/usr/sbin/td-agent-gemを開いてみると

#!/bin/sh
export GEM_HOME="/opt/td-agent/embedded/lib/ruby/gems/2.1.0/"
export GEM_PATH="/opt/td-agent/embedded/lib/ruby/gems/2.1.0/"
/opt/td-agent/embedded/bin/fluent-gem "$@"

環境変数設定してfluent-gemをよんでいました。


こんな感じでfulentdをインストール

yum -y groupinstall "Development Tools"
curl -L https://td-toolbelt.herokuapp.com/sh/install-redhat-td-agent2.sh | sh

fluentに付いてきたgemでfluent-plugin-forestをインストール

/opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.12/bin/fluent-gem install fluent-plugin-forest --no-rdoc --no-ri

td-agentを起動してみると以下の様なログが

[error]: dry run failed: Unknown output plugin 'forest'. Run 'gem search -rd fluent-plugin' to find plugins

forestが入っていないと・・・

/opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.12/bin/fluent-gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.14
  - RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/share/ruby/gems/2.0
  - RUBY EXECUTABLE: /usr/bin/ruby2.0
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/share/ruby/gems/2.0
     - /root/.gem/ruby/2.0
     - /usr/share/ruby/gems/2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
ls /usr/local/share/ruby/gems/2.0/gems
fluent-plugin-forest-0.3.0

入っているけど、多分fluentはこっち使っていない。

ls /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/

はいっていない。。。ってことで

GEM_HOME="/opt/td-agent/embedded/lib/ruby/gems/2.1.0/" \
GEM_PATH="/opt/td-agent/embedded/lib/ruby/gems/2.1.0/" \
/opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.12/bin/fluent-gem install fluent-plugin-forest --no-rdoc --no-ri

ls /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/
fluent-plugin-forest-0.3.0

OK.

おまけ

久しぶりにfluentを設置したらs3_endpointがs3_regionにかわっていた。起動はするけどログが来るとエラーを吐く。

[error]: failed to configure sub output s3: s3_endpoint parameter is not supported for S3, use s3_region instead. This parameter is for S3 compatible services
s3_endpoint s3-ap-northeast-1.amazonaws.com
↓
s3_region ap-northeast-1

でOK.

14
9
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?