伪分布式搭建
flume主要有0.9和1.6两个版本,这里使用0.9版本
1.下载flume-0.9.4-cdh4.1.5
2.解压后进入到项目目录
3.执行bin/flume master,查看master可用http://host:35871/
4.另启一个终端执行bin/flume node,查看agent可用http://master:35862/
5.在http://host:35871/上,点config,提交一个配置
configure node : master(我机器的主机名)
source : tail("/home/hadoop/flume_file/sourcefile")
sink : text("/home/hadoop/flume_file/sinkfile")
6.回到配置主页面状态显示SUCCEEDED
7.现在向sourcefile追加内容,echo 'hello world' >> sourcefile
8.查看同步的sinkfile,显示master [INFO Sat Jun 18 17:35:01 CST 2016] { tailSrcFile : sourcefile } hello world
这样使用flume中的agent,没有使用到collector,在本机器同步数据。
下篇测试多机部署数据同步。
下面关于flume中的master、node介绍是从官方文档翻译的,水平很有限,如有问题请见谅并指出https://github.com/whx4J8/whx4j8.github.io
非分布式模式
flume有两种模式