flume练手

来源:互联网 发布:蔡珍妮的淘宝店 编辑:程序博客网 时间:2024/04/29 02:08

一、牛刀小试

(一)

1/home/ut/hadoop/apache-flume-1.6.0-bin/conf下创建vim avro.conf

 

a1.sources = r1

a1.sinks = k1

a1.channels = c1

 

# Describe/configure the source

a1.sources.r1.type = avro

a1.sources.r1.channels = c1

a1.sources.r1.bind = 0.0.0.0

a1.sources.r1.port = 4141

 

# Describe the sink

a1.sinks.k1.type = logger

 

# Use a channel which buffers events in memory

a1.channels.c1.type = memory

a1.channels.c1.capacity = 1000

a1.channels.c1.transactionCapacity = 100

 

# Bind the source and sink to the channel

a1.sources.r1.channels = c1

a1.sinks.k1.channel = c1

2、启动

Ø /home/ut/hadoop/apache-flume-1.6.0-bin/bin/flume-ng agent -c . -f /home/ut/hadoop/apache-flume-1.6.0-bin/conf/avro.conf -n a1 -Dflume.root.logger=INFO,console

Ø echo "hello world" > /home/ut/hadoop/apache-flume-1.6.0-bin/log/log.00

 

Ø ./flume-ng avro-client -c . -H m1 -p 4141 -F /home/ut/hadoop/apache-flume-1.6.0-bin/log/log.00

Ø 接受到了消息

 

0 0