flume安装配置

flume安装配置

下载flume

wget http://mirror.bit.edu.cn/apache/flume/1.8.0/apache-flume-1.8.0-bin.tar.gz /opt/apache-flume-1.8.0-bin.tar.gz
cd /opt/
tar zxvf apache-flume-1.8.0-bin.tar.gz
cd apache-flume-1.8.0-bin

配置

vi conf/kafka2hdfs/kafka2hdfs.properties

a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = spooldir
a1.sources.r1.channels = c1
a1.sources.r1.spoolDir = /home/data/testflume
a1.sources.r1.fileHeader = true
# Describe the sink
a1.sinks.k1.type = logger
a1.sinks.k1.channel = c1

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

验证

bin/flume-ng version

启动

```
nohup bin/flume-ng agent --conf conf  -f conf/kafka2hdfs/kafka2hdfs.properties --name kafka2hdfs_ods_real_madrid_baiqishi -Dflume.root.logger=INFO,console > ./logs/kafka2hdfs.log 2>&1 &



上一篇:Flume安装配置


下一篇:大数据开发:(三)flume上传HDFS