flume-ng tmp

flume-ng 是一个分布式,高可用的日志收集系统。主要用来将分布在不同服务器上的业务日志汇总在一个集中的数据存储中心

一 安装与环境配置

下载地址 http://flume.apache.org/download.html , 下载Apache
Flume binary至目标服务器解压

运行环境java版本:Java 1.6 or later (Java 1.7 Recommended)

配置JAVA_HOME变量

将解压文件路径/bin配置加入环境变量

二 命令参数

Usage: /home/dongxiao.yang/apache-flume-1.4.0-bin/bin/flume-ng <command>
[options]...

commands:
help display this help text
agent run a Flume
agent
avro-client run an avro Flume client
version show Flume version
info

global options:
--conf,-c <conf> use configs in <conf>
directory
--classpath,-C <cp> append to the classpath
--dryrun,-d do
not actually start Flume, just print the command
--plugins-path <dirs>
colon-separated list of plugins.d directories. See the
plugins.d section in
the user guide for more details.
Default:
$FLUME_HOME/plugins.d
-Dproperty=value sets a Java system property
value
-Xproperty=value sets a Java -X option

agent options:
--conf-file,-f <file> specify a config file
(required)
--name,-n <name> the name of this agent
(required)
--help,-h display help text

avro-client options:
--rpcProps,-P <file> RPC client properties file
with server connection params
--host,-H <host> hostname to which events
will be sent
--port,-p <port> port of the avro source
--dirname
<dir> directory to stream to avro source
--filename,-F <file>
text file to stream to avro source (default: std input)
--headerFile,-R
<file> File containing event headers as key/value pairs on each new
line
--help,-h display help text

Either --rpcProps or both --host and --port must be specified.

Note that if <conf> directory is specified, then it is always included
first
in the classpath.

配置文件简单例子

#define
agent1.sources = source1
agent1.channels =
channel1
agent1.sinks = sink1 sink2

#Describe the source
agent1.sources.source1.type =
exec
agent1.sources.source1.command = tail -F
/srv/apps/taskworker/log/taskworker.log
agent1.sources.source1.interceptors=e1
agent1.sources.source1.interceptors.e1.type=timestamp

#Describe the sink
agent1.sinks.sink1.type =
avro
agent1.sinks.sink1.hostname= 10.4.1.100
agent1.sinks.sink1.port =
10000

#Describe the channnel
agent1.channels.channel1.type =
file
agent1.channels.channel1.checkpointDir = /home/dongxiao.yang/checkpoint
agent1.channels.channel1.dataDirs
= /home/dongxiao.yang/data

#Bind the source and sink to the
channel
agent1.sources.source1.channels =
channel1
agent1.sinks.sink1.channel = channel1
agent1.sinks.sink2.channel
= channel1

启动命令格式:

flume-ng agent --conf /home/dongxiao.yang/apache-flume-1.4.0-bin/conf/ --conf-file
/home/dongxiao.yang/apache-flume-1.4.0-bin/conf/

--name agent1 -Dflume.root.logger=INFO,console -Duser.timezone=UTC

参考资料:http://flume.apache.org/FlumeUserGuide.html  官方文档

Apache
Flume Distributed Log Collection for
Hadoop.pdf
  基于1.3版本,主要介绍了收集常见日志文件写入hdfs的几个结构

时间: 2024-08-11 02:47:13

flume-ng tmp的相关文章

Flume NG 学习笔记(五)Sinks和Channel配置

一.HDFS Sink Flume Sink是将事件写入到Hadoop分布式文件系统(HDFS)中.主要是Flume在Hadoop环境中的应用,即Flume采集数据输出到HDFS,适用大数据日志场景. 目前,它支持HDFS的文本和序列文件格式,以及支持两个文件类型的压缩.支持将所用的时间.数据大小.事件的数量为操作参数,对HDFS文件进行关闭(关闭当前文件,并创建一个新的).它还可以对事源的机器名(hostname)及时间属性分离数据,即通过时间戳将数据分布到对应的文件路径. HDFS目录路径可

Flume NG 简介及配置实战

Flume 作为 cloudera 开发的实时日志收集系统,受到了业界的认可与广泛应用.Flume 初始的发行版本目前被统称为 Flume OG(original generation),属于 cloudera.但随着 FLume 功能的扩展,Flume OG 代码工程臃肿.核心组件设计不合理.核心配置不标准等缺点暴露出来,尤其是在 Flume OG 的最后一个发行版本 0.94.0 中,日志传输不稳定的现象尤为严重,为了解决这些问题,2011 年 10 月 22 号,cloudera 完成了

Flume NG源码分析(五)使用ThriftSource通过RPC方式收集日志

上一篇说了利用ExecSource从本地日志文件异步的收集日志,这篇说说采用RPC方式同步收集日志的方式.笔者对Thrift比较熟悉,所以用ThriftSource来介绍RPC的日志收集方式. 整体的结构图如下: 1. ThriftSource包含了一个Thrift Server,以及一个Thrift Service服务的实现.这里的Thrift Service是由ThriftSourceProtocol定义 2. 应用程序调用Thrift Service的客户端,以RPC的方式将日志发送到Th

Flume NG 学习笔记(一)简介

一.简介 Flume是一个分布式.可靠.高可用的海量日志聚合系统,支持在系统中定制各类数据发送方,用于收集数据:同时,Flume提供对数据的简单处理,并写到各种数据接收方的能力. Flume在0.9.x and 1.x之间有较大的架构调整,1.x版本之后的改称Flume NG(next generation),0.9.x的称为Flume OG(originalgeneration). 对于OG版本, Flume NG (1.x.x)的主要变化如下: 1.sources和sinks 使用chann

【Flume NG用户指南】(2)构造

作者:周邦涛(Timen) Email:[email protected] 转载请注明出处:  http://blog.csdn.net/zhoubangtao/article/details/28277575 上一篇请參考[Flume NG用户指南](1)设置 3. 配置 前边的文章已经介绍过了,Flume Agent配置是从一个具有分层属性的Java属性文件格式的文件里读取的. 3.1 定义数据流 要在一个Flume Agent中定义数据流,你须要通过一个Channel将Source和Sin

【Flume NG用户指南】(2)配置

作者:周邦涛(Timen) Email:[email protected] 转载请注明出处:  http://blog.csdn.net/zhoubangtao/article/details/28277575 上一篇请参考[Flume NG用户指南](1)设置 3. 配置 前边的文章已经介绍过了,Flume Agent配置是从一个具有分层属性的Java属性文件格式的文件中读取的. 3.1 定义数据流 要在一个Flume Agent中定义数据流,你需要通过一个Channel将Source和Sin

分布式实时日志系统(二) 环境搭建之 flume 集群搭建/flume ng资料

最近公司业务数据量越来越大,以前的基于消息队列的日志系统越来越难以满足目前的业务量,表现为消息积压,日志延迟,日志存储日期过短,所以,我们开始着手要重新设计这块,业界已经有了比较成熟的流程,即基于流式处理,采用 flume 收集日志,发送到 kafka 队列做缓冲,storm 分布式实时框架进行消费处理,短期数据落地到 hbase.mongo中,长期数据进入 hadoop 中存储. 接下来打算将这其间所遇到的问题.学习到的知识记录整理下,作为备忘,作为分享,带给需要的人. 学习flume ng的

Flume 学习笔记之 Flume NG+Kafka整合

Flume NG集群+Kafka集群整合: 修改Flume配置文件(flume-kafka-server.conf),让Sink连上Kafka hadoop1: #set Agent name a1.sources = r1 a1.channels = c1 a1.sinks = k1 #set channel a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.channels.c1.transactionCapacit

Flume 学习笔记之 Flume NG高可用集群搭建

Flume NG高可用集群搭建: 架构总图: 架构分配: 角色 Host 端口 agent1 hadoop3 52020 collector1 hadoop1 52020 collector2 hadoop2 52020 agent1配置(flume-client.conf): #agent1 name agent1.channels = c1 agent1.sources = r1 agent1.sinks = k1 k2 #set gruop agent1.sinkgroups = g1 #

Flume NG源代码分析(二)支持执行时动态改动配置的配置模块

在上一篇中讲了Flume NG配置模块主要的接口的类,PropertiesConfigurationProvider提供了基于properties配置文件的静态配置的能力,这篇细说一下PollingPropertiesFileConfigurationProvider提供的执行时动态改动配置并生效的能力. 要实现动态改动配置文件并生效,主要有两个待实现的功能 1. 观察配置文件是否改动 2. 假设改动,将改动的内容通知给观察者 对于第一点,监控配置文件是否改动,Flume NG定义了一个File