首页 > 代码库 > Hadoop实战-Flume之Hello world(九)

Hadoop实战-Flume之Hello world(九)

环境介绍: 主服务器ip:192.168.80.128

1、准备apache-flume-1.7.0-bin.tar文件

2、上传到master(192.168.80.128)服务器上

3、解压apache-flume-1.7.0-bin.tar  

 tar -zxvf apache-flume-1.7.0-bin.tar


4、进入到Flume的配置文件目录

cd /apache-flume-1.7.0-bin/conf

 

5、修改apache-flume-1.7.0-bin/conf的里面内容

a1.sources = r1 

a1.sinks = k1 

a1.channels = c1

a1.sources.r1.type = netcat 

a1.sources.r1.bind = localhost 

a1.sources.r1.port = 44444

a1.sinks.k1.type = logger

a1.channels.c1.type = memory

a1.channels.c1.capacity = 1000 

a1.channels.c1.transactionCapacity = 100

a1.sources.r1.channels = c1 

a1.sinks.k1.channel = c1


5、启动Flume程序

bin/flume-ng agent --conf conf --conf-file /home/hadoop/apache-flume-1.7.0-bin/conf/flume-conf.properties --name a1 -Dflume.root.logger=INFO,console


ps:如果后台启动,在步骤5的基础上再加入

-n agent1 > log.log 2>&1 &

6、在另外的窗口输入 telnet localhost 44444

Hadoop实战-Flume之Hello world(九)