从无到有系列之flume-安装部署01

来源:互联网 发布:怪物猎人捏脸数据库女 编辑:程序博客网 时间:2024/05/21 07:08
1.下载flume并解压:     wget 命令下载
wget http://www.apache.org/dyn/closer.cgi/flume/1.6.0/apache-flume-1.6.0-bin.tar.gz
手动下载: http://flume.apache.org/download.html

2.解压:tar zxf     apache-flume-1.6.0-bin.tar.gz
(1)添加环境变量 gedit/etc/profile
#forflume1.6.0
exportFLUME_HOME=/home/hadoop/apache-flume-1.6.0-bin
exportFLUME_CONF_DIR=$FLUME_HOME/conf
exportPATH=$PATH:$FLUME_HOME/bin
(2)配置flume-env.sh文件
$FLUME_HOME/conf     下复制改名flume-env.sh.template为flume-env.sh
 
cp     flume-env.sh.template flume-env.sh

(3)修改JAVA_HOME和JAVA_OPTS    
exportJAVA_HOME=/home/hadoop/jdk1.7.0_75
exportJAVA_OPTS="-Xms100m -Xmx2000m -Dcom.sun.management.jmxremote"
3.flume的测试(一)telnet运行控制台输出
$FLUME_HOME/conf目录下修改flume-conf.properties.template文件,复制并改名为flume-conf  

#example.conf: A single-node Flume configuration
# Namethe components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
#Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444
#Describe the sink
a1.sinks.k1.type = logger
# Use achannel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# Bindthe source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
4.flume的安装目录/apache-flume-1.6.0-bin下运行
bin/flume-ng agent --conf conf --conf-file example.conf --name a1 -Dflume.root.logger=INFO,console

5.再打开一个终端,输入命令:telnet localhost     44444,输入“hello world”

6.再看另一个终端是否有信息hello world打印出来



本文参考转载至:http://flume.apache.org/FlumeUserGuide.html    http://f.dataguru.cn/thread-523804-1-1.html

0 0
原创粉丝点击