flume linux 命令,Linux环境Flume安装配置及使用
# Flume監(jiān)聽本地Linux-hive日志文件采集到HDFS——配置文件
# Name the components on this agent agent別名設(shè)置
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# Describe/configure the source 設(shè)置數(shù)據(jù)源監(jiān)聽本地文件配置
# exec 執(zhí)行一個(gè)命令的方式去查看文件 tail -F 實(shí)時(shí)查看
a1.sources.r1.type = exec
# 要執(zhí)行的腳本command tail -F 默認(rèn)10行 man tail 查看幫助
# 監(jiān)聽hive操作日志
a1.sources.r1.command = tail -F /tmp/root/hive.log
# 執(zhí)行這個(gè)command使用的是哪個(gè)腳本 -c 指定使用什么命令
# whereis bash
# bash: /usr/bin/bash /usr/share/man/man1/bash.1.gz
a1.sources.r1.shell = /usr/bin/bash -c
# Describe the sink 設(shè)置sink
# 指定sink類型
a1.sinks.k1.type = hdfs
# 指定HDFS路徑 %Y%m%d/%H%M%S 日期時(shí)間 ————修改項(xiàng)
a1.sinks.k1.hdfs.path = hdfs://bigdata01:9000/flume/%Y%m%d/%H-%M
#上傳文件的前綴
a1.sinks.k1.hdfs.filePrefix = logs-
#是否按照時(shí)間滾動(dòng)文件夾
a1.sinks.k1.hdfs.round = true
#多少時(shí)間單位創(chuàng)建一個(gè)新的文件夾 秒 (默認(rèn)30s)
a1.sinks.k1.hdfs.roundValue = 1
#重新定義時(shí)間單位(每分鐘滾動(dòng)一個(gè)文件夾)
a1.sinks.k1.hdfs.roundUnit = minute
#是否使用本地時(shí)間戳
a1.sinks.k1.hdfs.useLocalTimeStamp = true
#積攢多少個(gè) Event 才 flush 到 HDFS 一次
a1.sinks.k1.hdfs.batchSize = 500
#設(shè)置文件類型,可支持壓縮
a1.sinks.k1.hdfs.fileType = DataStream
#多久生成一個(gè)新的文件 秒
a1.sinks.k1.hdfs.rollInterval = 30
#設(shè)置每個(gè)文件的滾動(dòng)大小 字節(jié)(最好128M)
a1.sinks.k1.hdfs.rollSize = 134217700
#文件的滾動(dòng)與 Event 數(shù)量無關(guān)
a1.sinks.k1.hdfs.rollCount = 0
#最小冗余數(shù)(備份數(shù) 生成滾動(dòng)功能則生效roll hadoop本身有此功能 無需配置) 1份 不冗余
a1.sinks.k1.hdfs.minBlockReplicas = 1
# Use a channel which buffers events in memory 設(shè)置channel 使用內(nèi)存 總大小1000 每次傳輸100
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# Bind the source and sink to the channel 指定channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
復(fù)制代碼
總結(jié)
以上是生活随笔為你收集整理的flume linux 命令,Linux环境Flume安装配置及使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java restful文件传输_jav
- 下一篇: python 命名管道_Python:检