1. 程式人生 > >環境搭建記錄

環境搭建記錄

1,flume  tail:

baidudeMacBook-Pro:conf shaokai$ cat exec_tail.conf
#下面的agent1是代理名稱
agent1.sources = s1
agent1.channels = c1
agent1.sinks = k1


#配置資料來源source
agent1.sources.s1.type = exec
agent1.sources.s1.channels = c1
agent1.sources.s1.command = tail -f /Users/baidu/Library/Caches/IntelliJIdea14/tomcat/Unnamed_watt-fengmai/logs/watt.log
agent1.sources.s1.batchSize=10
agent1.sources.s1.batchTimeout=1000




# 配置記憶體 channel
agent1.channels.c1.type = memory
agent1.channels.c1.capacity = 50000
agent1.channels.c1.transactionCapacity = 10000


# 配置 sinks
agent1.sinks.k1.channel = c1
agent1.sinks.k1.type = file_roll
agent1.sinks.k1.sink.directory = /tmp/flume
#預設值為30,即每30秒生成一個檔案
#為0時表示只有一個檔案存放資料
agent1.sinks.k1.sink.rollInterval  =600
#設定的越大吞吐能力越好,延時也越大
agent1.sinks.k1.sink.batchSize=10
baidudeMacBook-Pro:conf shaokai$

baidudeMacBook-Pro:apache-flume-1.7.0-bin shaokai$ nohup ./bin/flume-ng agent -n agent1 -c conf -f conf/exec_tail.conf -Dflume.root.logger=INFO,console
appending output to nohup.out

http://www.aboutyun.com/thread-8917-1-1.html

2,