Fluentd 官方原始碼編譯安裝在 RedHat 上因 Ruby Gem 依賴問題失敗(rake aborted: Unable to determine name from existing gemspec)。改用系統安裝 Ruby 1.9.3 後,透過 gem install fluentd 順利完成部署並驗證監聽埠 24224/8888。

tar zxvf fluentd-0.10.6.tar.gz
cd fluentd-0.10.6
./configure && make
make install # 此處報錯 rake aborted...
wget https://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
tar zxvf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0
./configure && make && make install
ruby -v # ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
gem install fluentd
# 忽略 yaml.rb 警告,等待完成
fluentd --setup /etc/fluent
fluentd -c /etc/fluent/fluent.conf -vv &
# 確認監聽埠
netstat -na | grep 88
tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN
# 發送測試資料
echo '{"json":"message"}' | fluent-cat debug.test
# 日誌輸出
2012-09-27 17:45:32 +0800 debug.test: {"json":"message"}
啟動時自動載入 in_forward、in_http、out_file、out_forward、filter_parser 等核心插件。
td-agent 官方穩定套件(含 Ruby、Jemalloc 優化)。/etc/fluent/fluent.conf 設定 source/match 路由規則。systemd 管理服務:systemctl enable td-agent。