Flume配置檔案簡單整理

2021-09-05 03:37:11 字數 2964 閱讀 9984

各配置檔案資訊如下:

一、flume監控hive日誌資訊並上傳到hdfs:

# name the components on this agent a2.sources = r2

a2.sinks = k2 a2.channels = c2

# describe/configure the source a2.sources.r2.type = exec

a2.sources.r2.command = tail -f /hive安裝路徑/hive.log

a2.sources.r2.shell = /bin/bash -c

# describe the sink a2.sinks.k2.type = hdfs

a2.sinks.k2.hdfs.path = hdfs://namenodeip:8020/指定儲存路徑

#上傳檔案的字首

a2.sinks.k2.hdfs.fileprefix = logs-

#是否按照時間滾動資料夾

a2.sinks.k2.hdfs.round = true

#多少時間單位建立乙個新的資料夾

a2.sinks.k2.hdfs.roundvalue = 1

#重新定義時間單位

a2.sinks.k2.hdfs.roundunit = hour

#是否使用本地時間戳

a2.sinks.k2.hdfs.uselocaltimestamp = true

#積攢多少個event 才 flush 到 hdfs 一次

a2.sinks.k2.hdfs.batchsize = 1000

#設定檔案型別,可支援壓縮

a2.sinks.k2.hdfs.filetype = datastream

#多久生成乙個新的檔案

a2.sinks.k2.hdfs.rollinterval = 600

#設定每個檔案的滾動大小

a2.sinks.k2.hdfs.rollsize = 134217700

#檔案的滾動與 event 數量無關

a2.sinks.k2.hdfs.rollcount = 0

#最小副本數

a2.sinks.k2.hdfs.minblockreplicas = 1

# use a channel which buffers events in memory

a2.channels.c2.type = memory

a2.channels.c2.capacity = 1000

a2.channels.c2.transactioncapacity = 100

# bind the source and sink to the channel

a2.sources.r2.channels = c2

a2.sinks.k2.channel = c2

二、flume監聽整個目錄的檔案並儲存到hdfs

a3.sources = r3 

a3.sinks = k3

a3.channels = c3

# describe/configure the source

a3.sources.r3.type = spooldir

a3.sources.r3.spooldir = 想要監聽的目錄

a3.sources.r3.filesuffix = .completed

a3.sources.r3.fileheader = true

#忽略所有以.tmp 結尾的檔案,不上傳

a3.sources.r3.ignorepattern = ([^ ]*\.tmp)

# describe the sink

a3.sinks.k3.type = hdfs

a3.sinks.k3.hdfs.path = hdfs://namenodeip:8020/儲存目錄

#上傳檔案的字首

a3.sinks.k3.hdfs.fileprefix = upload-

#是否按照時間滾動資料夾

a3.sinks.k3.hdfs.round = true

#多少時間單位建立乙個新的資料夾

a3.sinks.k3.hdfs.roundvalue = 1

#重新定義時間單位

a3.sinks.k3.hdfs.roundunit = hour

#是否使用本地時間戳

a3.sinks.k3.hdfs.uselocaltimestamp = true

#積攢多少個event 才 flush 到 hdfs 一次

a3.sinks.k3.hdfs.batchsize = 100

#設定檔案型別,可支援壓縮

a3.sinks.k3.hdfs.filetype = datastream

#多久生成乙個新的檔案

a3.sinks.k3.hdfs.rollinterval = 600

#設定每個檔案的滾動大小大概是 128m

a3.sinks.k3.hdfs.rollsize = 134217700

#檔案的滾動與 event 數量無關

a3.sinks.k3.hdfs.rollcount = 0

#最小冗餘數

a3.sinks.k3.hdfs.minblockreplicas = 1

# use a channel which buffers events in memory

a3.channels.c3.type = memory

a3.channels.c3.capacity = 1000

a3.channels.c3.transactioncapacity = 100

# bind the source and sink to the channel

a3.sources.r3.channels = c3

a3.sinks.k3.channel = c3

flume配置檔案example

flume配置檔案example agent1表示 名稱 agent1.sources source1 agent1.sinks sink1 agent1.channels channel1 spooling directory是監控指定資料夾中新檔案的變化,一旦新檔案出現,就解析該檔案內容,然後寫...

Flume配置檔案1

flume監聽埠的配置檔案 smple.conf a single node flume configuration name the components on this agent 定義變數方便呼叫 加s可以有多個此角色 a1.sources r1 a1.sinks k1 a1.channels...

Flume 的配置檔案

1 在 elk 03 的 bd flume 1.7 conf 目錄下建立 kafka flume hdfs.conf 檔案 hadoop elk 03 conf vim kafka flume hdfs.conf 2 在檔案配置如下內容 元件定義 a1.sources r1 r2 a1.channe...