前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >flume-ng tmp

flume-ng tmp

作者头像
sanmutongzi
发布2020-03-04 14:31:00
1.1K0
发布2020-03-04 14:31:00
举报
文章被收录于专栏:stream process

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的几个结构

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2014-06-10 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
数据保险箱
数据保险箱(Cloud Data Coffer Service,CDCS)为您提供更高安全系数的企业核心数据存储服务。您可以通过自定义过期天数的方法删除数据,避免误删带来的损害,还可以将数据跨地域存储,防止一些不可抗因素导致的数据丢失。数据保险箱支持通过控制台、API 等多样化方式快速简单接入,实现海量数据的存储管理。您可以使用数据保险箱对文件数据进行上传、下载,最终实现数据的安全存储和提取。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档