抽空装了一下w
1、下载安装apache flume
[cc lang="php"]
sudo wget http://mirror.bit.edu.cn/apache/flume/1.6.0/apache-flume-1.6.0-bin.tar.gz
sudo tar -zxvf apache-flume-1.6.0-bin.tar.gz
sudo mv apache-flume-1.6.0-bin flume
[/cc]
设置环境变量
sudo nano /etc/profile
加入如下内容
FLUME_HOME=/mnt/study/flume
在PATH后加入
:$FLUME_HOME/bin
修改配置文件
[cc lang="php"]
cd flume/conf
sudo cp flume-conf.properties.template simple.conf
[/cc]
修改为以下内容
[cc lang="php"]
agent.sources = s1
agent.channels = c1
agent.sinks = sk1
# For each one of the sources, the type is defined
agent.sources.s1.type = netcat
a1.sources.s1.bind = localhost
a1.sources.s1.port = 95270
# The channel can be defined as follows.
agent.sources.s1.channels = c1
# Each sink's type must be defined
agent.sinks.sk1.type = logger
#Specify the channel the sink should use
agent.sinks.sk1.channel = c1
# Each channel's type is defined.
agent.channels.c1.type = memory
# Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
agent.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100
# Bind the source and sink to the channel
a1.sources.s1.channels = c1
a1.sinks.sk1.channel = c1
[/cc]
2、启动agent
[cc lang="php"]
source /etc/profile
/mnt/study/flume/conf$ flume-ng agent --conf conf --conf-file simple.conf --name a1 -Dflume.root.logger=INFO,console
[/cc]
利用flume-ng命令查看版本号
/mnt/study/flume/conf$ flume-ng version
[cc lang="php"]
Flume 1.6.0
Source code repository: https://git-wip-us.apache.org/repos/asf/flume.git
Revision: 2561a23240a71ba20bf288c7c2cda88f443c2080
Compiled by hshreedharan on Mon May 11 11:15:44 PDT 2015
From source with checksum b29e416802ce9ece3269d34233baf43f
[/cc]
参考文献:
flume依赖于hadoop吗
Flume入门教程-简单案例
Flume 1.6.0 User Guide
Flume介绍、安装配置 详细图解
查看原文:http://dsouth.all123.net:9527/wordpress/archives/199.html