flume安装
2015-12-31 10:03
246 查看
flume安装
1 .flume的官方网站 http://flume.apache.org/ 下载flume安装包 apache-flume-1.6.0-bin.tar.gz
2. 将下载的flume包,解压到/usr/softinstall/目录下
3. 在/usr/softinstall/flume/conf目录下 更名
flume-env.sh.template 文件
4.修改flume-env.sh主要是JAVA_HOME变量设置
6.验证是否安装成功
实例Spool
Spool监测配置的目录下新增的文件,并将文件中的数据读取出来。需要注意两点:
1) 拷贝到spool目录下的文件不可以再打开编辑。
2) spool目录下不可包含相应的子目录
a)创建agent配置文件
b)启动flume agent a1
c)追加文件到/home/hadoop/flume-1.5.0-bin/logs目录
d)在hadoop0的控制台,可以看到以下相关信息:
更多实例参考http://www.niubua.com/?p=724
1 .flume的官方网站 http://flume.apache.org/ 下载flume安装包 apache-flume-1.6.0-bin.tar.gz
2. 将下载的flume包,解压到/usr/softinstall/目录下
tar -zxvf apache-flume-1.6.0-bin.tar.gz |
flume-env.sh.template 文件
mv flume-env.sh.template flume-env.sh |
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # If this file is placed at FLUME_CONF_DIR/flume-env.sh, it will be sourced # during Flume startup. # Enviroment variables can be set here. export JAVA_HOME=/usr/softinstall/jdk # Give Flume more memory and pre-allocate, enable remote monitoring via JMX # export JAVA_OPTS="-Xms100m -Xmx2000m -Dcom.sun.management.jmxremote" # Note that the Flume conf directory is always included in the classpath. #FLUME_CLASSPATH="" |
[root@hadoop0 bin]# /usr/softinstall/flume/bin/flume-ng version 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 |
Spool监测配置的目录下新增的文件,并将文件中的数据读取出来。需要注意两点:
1) 拷贝到spool目录下的文件不可以再打开编辑。
2) spool目录下不可包含相应的子目录
a)创建agent配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | [root@hadoop0 bin]# vi /usr/softinstall/flume/conf/spool.conf a1.sources = r1 a1.sinks = k1 a1.channels = c1 # Describe/configure the source a1.sources.r1.type= spooldir a1.sources.r1.channels = c1 #指定监控的目录地址 a1.sources.r1.spoolDir =/usr/softinstall/flume/logs a1.sources.r1.fileHeader =true # Describe the sink a1.sinks.k1.type= logger # Use a channel which buffers events in memory a1.channels.c1.type= memory a1.channels.c1.capacity = 1000 a1.channels.c1.transactionCapacity = 100 # Bind the source and sink to the channel a1.sources.r1.channels = c1 a1.sinks.k1.channel = c1 |
1 | [root@hadoop0 conf]# /usr/softinstall/flume/bin/flume-ng agent -c . -f /usr/softinstall/flume/conf/spool.conf -n a1 -Dflume.root.logger=INFO,console |
-n 指定agent名称 -c 指定配置文件目录 -f 指定配置文件 -Dflume.root.logger=DEBUG,console 因此完整的启动命令应该这么写 bin/flume-ng agent –n a1 –c conf –f conf/spool.conf –Dflume.root.logger=DEBUG,console |
1 | [root@hadoop0 bin]# echo “spool test1″ > /usr/softinstall/flume/logs/spool_text.log |
2015-12-16 01:19:06,890 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.sink.LoggerSink.process(LoggerSink.java:94)] Event: { headers:{file=/usr/softinstall/flume/logs/spool_text.log} body: E2 80 9C 73 70 6F 6F 6C 20 68 65 6C 6C 6F 20 77 ...spool hello w } |
相关文章推荐
- 免费天气预报接口API以及全国所有地区代码
- Isgw 框架性能问题分析 - ACE定时器问题
- 软件方法阅读笔记(一)
- Django 安全策略的 7 条总结!
- Android Studio创建工程(不使用support v7)
- android6.0的权限讲解
- 2015年年终总结
- 从原始文档到KNN分类算法实现(一)
- Android的架构与设计模式
- C语言-算法题
- 2015年度总结——谁的青春不迷茫
- 什么时候使用回调函数和使用回调的好处
- Flume1.5.0的安装、部署、简单应用
- 【Western Digital】西数电路板安全模式
- angularJS的controller之间如何正确的通信
- 华为招聘机试整理14:数组奇数偶数排序
- iOS添加外部图片
- liunx 用户和用户组的命令
- MySQL~ IN , FIND_IN_SET , LIKE
- 文本分类,数据挖掘和机器学习