@tsing1226
2015-12-16T15:50:42.000000Z
字数 1194
阅读 1397
Flume是一个分布式、可靠性能够收集、聚合移动大数据日志文件的高效可用服务。
基于流式数据流简单的架构,健壮性和容错性使得可用机制和许多故障转移恢复机制。
使用简单的数据扩展模型可以在线分析应用。
Flume-ng只有一个角色的节点:agent的角色,而agent又source、channel、sink组成。其相关角色介绍如下:
软件下载地址:http://archive.cloudera.com/cdh5/cdh/5/flume-ng-1.5.0-cdh5.3.6.tar.gz
tar -zxf flume-ng-1.5.0-cdh5.3.6.tar.gz -C /opt/cdh3.5.6/
配置文件:flume-env.sh
export JAVA_HOME=/opt/modules/jdk1.7.0_67
配置文件flume-conf.properties
a1.sources = r1
a1.channels = c1
a1.sinks = k1
# For each one of the sources, the type is defined
a1.sources.r1.type = netcat
a1.sources.r1.bind =hadoop-senior01.grc.com
a1.sources.r1.port=4444
# The channel can be defined as follows.
a1.sources.r1.channels = c1
# Each sink's type must be defined
a1.sinks.k1.type = logger
#Specify the channel the sink should use
a1.sinks.k1.channel = c1
# Each channel's type is defined.
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
bin/flume-ng agent -n a1 -c conf -f conf/flume-conf.properties -Dflume.root.logger=INFO,console
sudo yum install telnet(若已安装不再需要安装)
打开端口4444
telnet hadoop-senior01.grc.com 4444
参考地址:http://archive.cloudera.com/cdh5/cdh/5/flume-ng-1.5.0-cdh5.3.6/FlumeUserGuide.html#exec-source