flume配置 動態檔案採集

2021-08-28 23:56:05 字數 1345 閱讀 4952

#定義三大元件的名稱

ag1.sources = source1

ag1.sinks = sink1

ag1.channels = channel1

# 配置source元件

ag1.sources.source1.type = exec

ag1.sources.source1.command = tail -f /root/log/access_log

# 配置sink元件

ag1.sinks.sink1.type = hdfs

ag1.sinks.sink1.hdfs.path =hdfs://hdp-01:9000/access_log/%y-%m-%d/%h-%m

ag1.sinks.sink1.hdfs.filesuffix = .log

ag1.sinks.sink1.hdfs.batchsize= 100

ag1.sinks.sink1.hdfs.filetype = datastream

ag1.sinks.sink1.hdfs.writeformat =text

## roll:滾動切換:控制寫檔案的切換規則

ag1.sinks.sink1.hdfs.rollsize = 512000 ## 按檔案體積(位元組)來切

ag1.sinks.sink1.hdfs.rollcount = 1000000 ## 按event條數切

ag1.sinks.sink1.hdfs.rollinterval = 60 ## 按時間間隔切換檔案

## 控制生成目錄的規則

ag1.sinks.sink1.hdfs.round = true

ag1.sinks.sink1.hdfs.roundvalue = 10

ag1.sinks.sink1.hdfs.roundunit = minute

ag1.sinks.sink1.hdfs.uselocaltimestamp = true

# channel元件配置

ag1.channels.channel1.type = memory

## event條數

ag1.channels.channel1.capacity = 500000

##flume事務控制所需要的快取容量600條event

ag1.channels.channel1.transactioncapacity = 600

# 繫結source、channel和sink之間的連線

ag1.sources.source1.channels = channel1

ag1.sinks.sink1.channel = channel1

flume常用採集動態檔案配置

tail hdfs.conf 這個是解決動態檔案,檔案裡,邊放邊採集 用tail命令獲取資料,下沉到hdfs 啟動命令 bin flume ng agent c conf f tail hdfs.conf n ag1 dflume.root.logger info,console 定義三大元件的名稱...

flume常用採集靜態檔案配置

定義三大元件的名稱 採集靜態檔案 啟動命令 bin flume ng agent c conf f dir hdfs.conf n ag1 dflume.root.logger info,console 將日誌列印在控制台,實際情況中將其放入黑洞中 配置如下 ag1.sources source1 ...

flume配置採集日誌

上傳dir hdfs.conf 到flume的conf目錄下 定義三大元件的名稱 ag1.sources source1 ag1.sinks sink1 ag1.channels channel1 配置source元件 ag1.sources.source1.type spooldir ag1.so...