Fluent 安装过程
2019獨角獸企業重金招聘Python工程師標準>>>
在Mac下安裝Fluentd:
sudo gem install fluentd --no-ri --no-rdoc WARNING: ?Error fetching data: too many connection resets (http://production.s3.rubygems.org/specs.4.8.gz) Successfully installed fluentd-0.10.32 1 gem installed報了這個錯誤。看不懂,google了下
http://stackoverflow.com/questions/10278174/gem-not-installing-showing-connection-error
This problem was caused by the cachefly server.
It seems that the folks over at rubygems.org disabled this mirror and then people's downloads were able to continue successfully.
There is a thread over at rubygems.org?discussing this issue.
不知道怎么解決~于是使用源碼安裝 $ git clone https://github.com/fluent/fluentd.git $ cd fluentd $ rake build Jeweler not available. Install it with: gem install jeweler rake aborted! Don't know how to build task 'build'(See full trace by running task with --trace) 又報錯了~~先裝jeweler,再rake build。 $ sudo gem install jeweler $ rake build /usr/local/Cellar/ruby/1.9.3-p286/lib/ruby/gems/1.9.1/gems/git-1.2.5/lib/git/lib.rb:709: warning: Insecure world writable dir /usr/local in PATH, mode 040777 WARNING: no description specifiedSuccessfully built RubyGemName: fluentdVersion: 0.10.32File: fluentd-0.10.32.gem $ sudo gem install pkg/fluentd-0.10.32.gem 安裝好啦~~接下來測試安裝情況 $ fluentd --setup ./fluent -bash: fluentd: command not found修改~/.bash_profile,添加
export PATH="/usr/local/Cellar/ruby/1.9.3-p286/lib/ruby/gems/1.9.1/gems/fluentd-0.10.32/bin:$PATH"
再次運行:
$ fluentd --setup ./fluent $ fluentd -c ./fluent/fluent.conf -vv & $ echo '{"json":"message"}' | fluent-cat debug.test?? 2013-03-13 22:41:54 +0800 [trace]: plugin/in_forward.rb:147:initialize: accepted fluent socket object_id=70313253903680 2013-03-13 22:41:54 +0800 debug.test: {"json":"message"} 2013-03-13 22:41:54 +0800 [trace]: plugin/in_forward.rb:188:on_close: closed fluent socket object_id=70313253903680
更多安裝方式:
http://docs.fluentd.org/categories/installation
http://www.cnblogs.com/xuxm2007/archive/2013/01/25/2876590.html
安裝mongo插件
$ sudo gem install fluent-plugin-mongo Fetching: bson-1.6.4.gem (100%) Fetching: mongo-1.6.4.gem (100%) Fetching: fluent-plugin-mongo-0.6.13.gem (100%) Successfully installed bson-1.6.4 Successfully installed mongo-1.6.4 Successfully installed fluent-plugin-mongo-0.6.13 3 gems installed$ sudo fluent-gem install fluent-plugin-mongo?
Successfully installed fluent-plugin-mongo-0.6.13 1 gem installed Installing ri documentation for fluent-plugin-mongo-0.6.13... Installing RDoc documentation for fluent-plugin-mongo-0.6.13...
$ fluentd -c ./fluent/fluent.conf -vv &........2013-03-14 23:21:25 +0800 [info]: fluent/engine.rb:61:configure: using configuration file: <ROOT><source>type forward</source><source>type httpport 8888</source><source>type tailformat apache2path /private/var/log/apache2/access_logpos_file /var/log/td-agent/apache2.access_log.postag mongo.apache</source><source>type debug_agentport 24230</source><match debug.**>type stdout</match><match mongo.**>type mongodatabase apachecollection accesshost 127.0.0.1port 27017flush_interval 10s</match> </ROOT> 2013-03-14 23:21:25 +0800 [info]: fluent/engine.rb:70:block in configure: adding source type="forward" 2013-03-14 23:21:25 +0800 [info]: fluent/engine.rb:70:block in configure: adding source type="http" 2013-03-14 23:21:25 +0800 [info]: fluent/engine.rb:70:block in configure: adding source type="tail" 2013-03-14 23:21:25 +0800 [info]: fluent/engine.rb:70:block in configure: adding source type="debug_agent" 2013-03-14 23:21:25 +0800 [info]: fluent/engine.rb:86:block in configure: adding match pattern="debug.**" type="stdout" 2013-03-14 23:21:25 +0800 [info]: fluent/engine.rb:86:block in configure: adding match pattern="mongo.**" type="mongo" 2013-03-14 23:21:25 +0800 [trace]: fluent/plugin.rb:89:register_impl: registered output plugin 'mongo' /usr/local/Cellar/ruby/1.9.3-p286/lib/ruby/1.9.1/rubygems/custom_require.rb:36: stack level too deep (SystemStackError) 2013-03-14 23:21:25 +0800 [info]: fluent/supervisor.rb:170:supervise: process finished code=256 2013-03-14 23:21:25 +0800 [warn]: fluent/supervisor.rb:173:supervise: process died within 1 second. exit. 2013-03-14 23:21:25 +0800 [trace]: fluent/plugin.rb:89:register_impl: registered output plugin 'mongo'
/usr/local/Cellar/ruby/1.9.3-p286/lib/ruby/1.9.1/rubygems/custom_require.rb:36: stack level too deep (SystemStackError)
這是什么東西~,各種谷歌,頭都大了,還是不知道怎么解決,只好向github求助
https://github.com/fluent/fluentd/issues/110 ,
在@?repeatedly?的建議下,
I first heard this issue.
Could you reduce the cause of this case?
For example:
- invoke fluentd without sudo
- remove non-related source or match
- degrade the fluentd version
- etc...
我降低了fluentd 的版本,重新安裝bson_ext版本(保持跟mongo同一版本),這才解決了問題。具體解決過程在上面issues鏈接里。
第一次在英文網站發表問題,讓英語小學水平的我獲得一點點興奮和滿足,哈哈~
一點點消除錯誤,一點點減少挫敗感
轉載于:https://my.oschina.net/u/1000151/blog/114130
總結
以上是生活随笔為你收集整理的Fluent 安装过程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Spring Cloud-鸿鹄Cloud
- 下一篇: 前端学习(3337):ant desig