flume data to hdfs
flume 开发梳理
flume 数据到hadoop
conf/hdfsAgent.conf
#配置sources、channels、sinks
a1.sources=r1
a1.channels=c1
a1.sinks=k1
#sources.r1 配置源数据类型
a1.sources.r1.type=exec
a1.sources.r1.shell=bin/bash -c
a1.sources.r1.command=ping 192.168.1.125
#channels c1 配置传输通道
a1.channels.c1.type=memory
a1.channels.c1.capacity=1000
a1.channels.c1.transactionCapacity=100
#sinks k1 配置接收数据
a1.sinks.k1.type=hdfs
a1.sinks.k1.hdfs.path=hdfs://192.168.1.125:9000/flume/webData
#关联sources、channels、sinks
a1.sources.r1.channels=c1
a1.sinks.k1.channel=c1
tips:
flume 配置输入到hadoop,需要把 hadoop-2.7.1/share/ hadoop/ 下的common/* common/lib/* hdfs/* hdfs/lib/* mapreduce/* mapreduce/lib/* 拷贝到flume-1.6.0/lib/* 目录下。
开启命令:
bin/flume-ng agent -c conf -f conf/hdfsAgent.conf -n a1
歡迎分享,謝謝!