Fluentd
Fluentd是一個(gè)日志收集系統(tǒng)剔交,它的特點(diǎn)在于其各部分均是可定制化的,你可以通過簡單的配置,將日志收集到不同的地方擅憔。
Fluentd-UI
FLuentd-UI提供了一個(gè)圖形界面纸镊,用于對Fluentd的管理倍阐。可以對Fluentd進(jìn)行啟動(dòng)逗威、停止收捣、配置等等操作
Fluentd安裝
系統(tǒng):Ubuntu 14.04.5 LTS
使用了Github地址上的安裝方式----gem。
雖然安裝命令簡單gem install fluentd
庵楷,但是安裝得好慢罢艾、好慢楣颠、好慢。咐蚯。童漩。。
因?yàn)槭鞘褂胓em安裝的春锋,所以需要Ruby矫膨。官方文檔要求Ruby>=1.9.3,我在機(jī)器上安裝了Ruby2.3期奔。
在/etc
中創(chuàng)建fluent
目錄侧馅,在目錄中運(yùn)行fluentd -s conf
初始化配置,此時(shí)會創(chuàng)建一個(gè)conf目錄呐萌,里面是fluentd的各種配置文件馁痴。運(yùn)行sudo fluentd -c conf/fluent.conf
啟動(dòng)fluentd。此時(shí)在新的Bash中運(yùn)行echo '{"json":"message"}' | fluent-cat debug.test
肺孤,然后在運(yùn)行fluentd的Bash中將會見到debug.test: {"json":"message"}
出現(xiàn)罗晕,這樣fluentd就安裝好了。
Fluentd-UI安裝
與Fluentd相同赠堵,選擇gem方式安裝小渊,命令是gem install -V fluentd-ui
因?yàn)镕luentd-UI可以對Fluentd進(jìn)行管理,所以我便沒有在機(jī)器上使用fluentd -s conf
茫叭、sudo fluentd -c conf/fluent.conf
來初始配置以及運(yùn)行酬屉。
Usages:
fluentd-ui help [COMMAND] # Describe available commands or one specific command
fluentd-ui setup # setup fluentd-ui server
fluentd-ui start # start fluentd-ui server
fluentd-ui status # status of fluentd-ui server
fluentd-ui stop # stop fluentd-ui server
使用了Supervisor來啟動(dòng)Fluentd-UI。
[program:fluentd_ui]
command=fluentd-ui start