flume data to hdfs

flume 开发梳理

flume 数据到hadoop

conf/hdfsAgent.conf

 #配置sources、channels、sinksa1.sources=r1a1.channels=c1a1.sinks=k1#sources.r1 配置源数据类型a1.sources.r1.type=execa1.sources.r1.shell=bin/bash -ca1.sources.r1.command=ping 192.168.1.125#channels c1 配置传输通道a1.channels.c1.type=memorya1.channels.c1.capacity=1000a1.channels.c1.transactionCapacity=100#sinks k1 配置接收数据a1.sinks.k1.type=hdfsa1.sinks.k1.hdfs.path=hdfs://192.168.1.125:9000/flume/webData#关联sources、channels、sinksa1.sources.r1.channels=c1a1.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

相关文章