设为首页 加入收藏

TOP

flume从本地读取数据录入到hdfs文件系统
2019-04-24 00:19:51 】 浏览:68
Tags:flume 本地 读取 数据录入 hdfs 文件 系统
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/snowpay/article/details/60961272

配置文件

agent.sources = origin
agent.channels = memorychannel
agent.sinks = target

agent.sources.origin.type = TAILDIR
agent.sources.origin.filegroups=f1
agent.sources.origin.filegroups.f1=/hadoop/flume/logs/test/.*.log*
agent.sources.origin.channels = memorychannel
agent.sources.origin.positionFile=/hadoop/flume/logs/test/position.json

agent.sinks.loggerSink.type = logger
agent.sinks.loggerSink.channel = memorychannel

agent.channels.memorychannel.type = memory
agent.channels.memorychannel.capacity = 1000
agent.channels.memorychannel.transactionCapacity = 100

agent.sinks.target.type = hdfs
agent.sinks.target.channel = memorychannel
agent.sinks.target.hdfs.path = hdfs://127.0.0.1:9000/flume/events/%y-%m-%d/%H%M%S
agent.sinks.target.hdfs.filePrefix = data-%{host}
agent.sinks.target.hdfs.rollInterval = 30
agent.sinks.target.hdfs.rollSize = 100
agent.sinks.target.hdfs.rollCount = 0
agent.sinks.target.hdfs.round = true
agent.sinks.target.hdfs.useLocalTimeStamp = true
agent.sinks.target.hdfs.minBlockReplicas=1
agent.sinks.target.hdfs.writeFormat=Text
agent.sinks.target.hdfs.fileType=DataStream

把hdfs的驱动包放入到flum的lib目录下

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇java对hdfs的上传、下载、读取文件 下一篇关于hdfs中的namenode和datanode..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目