flume的導日誌資料到hdfs

2021-07-26 06:40:15 字數 931 閱讀 8579

1.更改配置檔案

#agent名, source、channel、sink的名稱

a1.sources = r1

a1.channels = c1

a1.sinks = k1

#具體定義source

a1.sources.r1.type = spooldir

a1.sources.r1.spooldir = /root/flume-log

#具體定義channel

a1.channels.c1.type = memory

a1.channels.c1.capacity = 10000

a1.channels.c1.transactioncapacity = 100

#具體定義sink

a1.sinks.k1.type = hdfs

a1.sinks.k1.hdfs.path = hdfs:

a1.sinks.k1.hdfs.fileprefix = events-

a1.sinks.k1.hdfs.filetype = datastream

a1.sinks.k1.hdfs.uselocaltimestamp = true

#不按照條數生成檔案

a1.sinks.k1.hdfs.rollcount = 0

#hdfs上的檔案達到128m時生成乙個檔案

a1.sinks.k1.hdfs.rollsize = 134217728

#hdfs上的檔案達到60秒生成乙個檔案

a1.sinks.k1.hdfs.rollinterval = 30

#組裝source、channel、sink

a1.sources.r1.channels = c1

a1.sinks.k1.channel = c1

2.把系統組和系統使用者改為root

3.更新配置

Hadoop之Flume採集檔案到hdfs

內容如下 定義三大元件的名稱,myagent可以自己定義 myagent.sources source1 myagent.sinks sink1 myagent.channels channel1 配置source元件 myagent.sources.source1.type spooldir 定義...

Flume儲存日誌到MongoDB

然後放到 usr local 目錄下解壓 tar zxvf apache flume 1.5.2 bin.tar.gz 定義元件名稱 agent2.sources source2 agent2.sinks sink2 agent2.channels channel2 定義資料入口 agent2.so...

從flume到kafka,日誌收集

實時日誌分析 本篇文章主要測試 從flume到kafka的日誌收集,storm日誌分析,學習中!flume 配置檔案 collector collector.sources cs collector.sinks ck hbasesink collector.channels cc hbasechan...