apache flume collector 安装

2、Flume Collector安装(通过extends AbstractSink implements Configurable,直接写入数据库)

2.1 安装环境

系统:

CentOS release 6.6

软件:

flume-collector.tar.gz

2.2 安装步骤

2.2.1 部署Flume Collector

具体脚本(jyapp用户):

cd  /home/jyapp

tar  -zxvf  flume-collector.tar.gz

cd  flume-collector

#修改flume环境变量

vi  conf/flume-env.sh

具体配置解析:(注意:红色需修改)

------------------------------------------------------

export JAVA_OPTS="-Xms1000m -Xmx1000m  -Dflume.root.logger=INFO,LOGFILE -Dflume.monitoring.type=http  -Dflume.monitoring.port=34545  -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=本机IP  -Dcom.sun.management.jmxremote.port=9999
-Dcom.sun.management.jmxremote.authenticate=false  -Dcom.sun.management.jmxremote.ssl=false"

-------------------------------------------------------------------------------------

#修改Collector脚本

vi  conf/collector.conf

具体配置解析:(注意:红色需修改)

------------------------------------------------------

collector.sources = r1

collector.channels = c1 c2

collector.sinks = k1 k2 k3 k4 k5 k6

collector.sources.r1.type = avro

collector.sources.r1.bind = 收集端IP   #本机IP

collector.sources.r1.port = 收集端绑定端口  #本机接口消息端口

collector.channels.c1.type = memory

collector.channels.c1.capacity = 10000

collector.channels.c1.transactionCapacity = 10000

collector.channels.c1.byteCapacityBufferPercentage = 30

collector.channels.c1.byteCapacity = 1048576000

collector.channels.c2.type = memory

collector.channels.c2.capacity = 10000

collector.channels.c2.transactionCapacity = 10000

collector.channels.c2.byteCapacityBufferPercentage = 30

collector.channels.c2.byteCapacity = 1048576000

collector.sinks.k1.type = com.jy.modules.platform.flume.sink.OracleJdbcSink

collector.sinks.k1.url = jdbc:oracle:thin:@IP:PORT:数据库名

collector.sinks.k1.user =用户名

collector.sinks.k1.password =密码

collector.sinks.k2.type = com.jy.modules.platform.flume.sink.OracleJdbcSink

collector.sinks.k2.url = jdbc:oracle:thin:@IP:PORT:数据库名

collector.sinks.k2.user =用户名

collector.sinks.k2.password =密码

collector.sinks.k3.type = com.jy.modules.platform.flume.sink.OracleJdbcSink

collector.sinks.k3.url = jdbc:oracle:thin:@IP:PORT:数据库名

collector.sinks.k3.user =用户名

collector.sinks.k3.password =密码

collector.sinks.k4.type = com.jy.modules.platform.flume.sink.OracleJdbcSink

collector.sinks.k4.url = jdbc:oracle:thin:@IP:PORT:数据库名

collector.sinks.k4.user =用户名

collector.sinks.k4.password =密码

collector.sinks.k5.type = com.jy.modules.platform.flume.sink.OracleJdbcSink

collector.sinks.k5.url = jdbc:oracle:thin:@IP:PORT:数据库名

collector.sinks.k5.user =用户名

collector.sinks.k5.password =密码

collector.sinks.k6.type = com.jy.modules.platform.flume.sink.OracleJdbcSink

collector.sinks.k6.url = jdbc:oracle:thin:@IP:PORT:数据库名

collector.sinks.k6.user =用户名

collector.sinks.k6.password =密码

collector.sources.r1.channels = c1 c2

collector.sinks.k1.channel = c1

collector.sinks.k2.channel = c1

collector.sinks.k3.channel = c1

collector.sinks.k4.channel = c2

collector.sinks.k5.channel = c2

collector.sinks.k6.channel = c2

collector.sources.r1.selector.type = multiplexing

collector.sources.r1.selector.header = flume.client.system.flag

collector.sources.r1.selector.mapping.S000 = c1

collector.sources.r1.selector.mapping.S001 = c2

collector.sources.r1.selector.mapping.S002 = c1

collector.sources.r1.selector.mapping.S003 = c2

collector.sources.r1.selector.mapping.S004 = c1

collector.sources.r1.selector.mapping.S005 = c2

collector.sources.r1.selector.mapping.S006 = c1

collector.sources.r1.selector.mapping.S007 = c2

collector.sources.r1.selector.mapping.S008 = c1

collector.sources.r1.selector.mapping.S009 = c2

collector.sources.r1.selector.default = c1

collector.sinkgroups = g1 g2

collector.sinkgroups.g1.sinks = k1 k2 k3

collector.sinkgroups.g1.processor.type = load_balance

collector.sinkgroups.g1.processor.backoff = true

collector.sinkgroups.g1.processor.selector = round_robin

collector.sinkgroups.g2.sinks = k4 k5 k6

collector.sinkgroups.g2.processor.type = load_balance

collector.sinkgroups.g2.processor.backoff = true

collector.sinkgroups.g2.processor.selector = round_robin

-------------------------------------------------------------------------------------

后台启动collector

cd  /home/jyapp/flume-collector

bin/flume-ng  agent  --conf conf  --conf-file  conf/collector.conf  --name  collector   &

停止agent,使用kill命令

时间: 2024-10-07 03:21:43

apache flume collector 安装的相关文章

apache flume agent安装

1.Flume Agent安装(采用spoolDir模式以便获取系统.应用等日志信息) 注:使用jyapp用户安装 一台虚拟机部署了多个JAVA应用同时需要部署多个flume-agent进行监控时, 需要调整如下配置文件: a    flume-agent/conf/app.conf中的spool_Dir参数 b    flume-agent/conf/flume-env.sh中的jmxremote.port参数 c    logback.xml中fileNamePattern参数 d    f

Apache Flume 安装文档、日志收集

简介: 官网 http://flume.apache.org 文档 https://flume.apache.org/FlumeUserGuide.html hadoop 生态系统中,flume 的职责是收集数据,一般用作收集各种日志数据. Source -> Channel -> Sink 这是一个基本的工作流程. Source 定义了数据从哪里来,Channel 是一个数据暂存的位置 ( disk / mem ),Sink 定义将数据流向哪里! 一.flume 安装 shell >

让你系统认识flume及安装和使用flume1.5传输数据到hadoop2.2

问题导读:1.什么是flume?2.如何安装flume?3.flume的配置文件与其它软件有什么不同?一.认识flume1.flume是什么?这里简单介绍一下,它是Cloudera的一个产品2.flume是干什么的?收集日志的3.flume如何搜集日志?我们把flume比作情报人员(1)搜集信息(2)获取记忆信息(3)传递报告间谍信息flume是怎么完成上面三件事情的,三个组件:source: 搜集信息channel:传递信息sink:存储信息上面有点简练,详细可以参考Flume内置channe

flume学习安装

最近项目组有需求点击流日志需要自己收集,学习了一下flume并且安装成功了.相关信息记录一下. 1)下载flume1.5版本 wget http://www.apache.org/dyn/closer.cgi/flume/1.5.0.1/apache-flume-1.5.0.1-bin.tar.gz 2) 解压flume1.5 tar -zxvf apache-flume-1.5.0.1-bin.tar.gz 3) 配置环境变量 jdk已装 export FLUME_HOME=/XXX/XX/a

Flume NG安装部署及数据采集测试

转载请注明出处:http://www.cnblogs.com/xiaodf/ Flume作为日志收集工具,监控一个文件目录或者一个文件,当有新数据加入时,采集新数据发送给消息队列等. 1 安装部署Flume 若要采集数据节点的本地数据,每个节点都需要安装一个Flume工具,用来做数据采集. 1.1 下载并安装 到官网去下载最新版本的Flume 下载地址为:http://flume.apache.org/,目前最新版本为1.6.0,需要1.7及以上版本的JDK. 1.解压 tar -xzvf ap

Flume的安装配置

flume是一个分布式.可靠.和高可用的海量日志采集.聚合和传输的系统.支持在日志系统中定制各类数据发送方,用于收集数据;同时,Flume提供对数据进行简单处理,并写到各种数据接受方(比如文本.HDFS.Hbase等)的能力 . 一.什么是Flume? flume 作为 cloudera 开发的实时日志收集系统,受到了业界的认可与广泛应用.Flume 初始的发行版本目前被统称为 Flume OG(original generation),属于 cloudera.但随着 FLume 功能的扩展,F

Flume单机安装与配置

下载 apache-flume-1.6.0-bin.tar.gz 解压 tar -zxvf apache-flume-1.6.0-bin.tar.gz 配置 cp conf/flume-conf.properties.template conf/flume-conf.properties cp conf/flume-env.sh.template conf/flume-env.sh flume-env.sh # Enviroment variables can be set here. expo

Flume的安装与配置

Flume的安装与配置 一.       资源下载 资源地址:http://flume.apache.org/download.html 程序地址:http://apache.fayea.com/flume/1.6.0/apache-flume-1.6.0-bin.tar.gz 源码地址:http://mirrors.hust.edu.cn/apache/flume/1.6.0/apache-flume-1.6.0-src.tar.gz 二.       安装搭建 (1)编译好的包: 直接在安装

Flume的安装部署

1.Flume的安装非常简单,只需要解压即可,当然,前提是已有hadoop环境 上传安装包到数据源所在节点上 然后解压  tar -zxvf apache-flume-1.6.0-bin.tar.gz 然后进入flume的目录,修改conf下的flume-env.sh,在里面配置JAVA_HOME 2.根据数据采集的需求配置采集方案,描述在配置文件中(文件名可任意自定义) 3.指定采集方案配置文件,在相应的节点上启动flume agent 先用一个最简单的例子来测试一下程序环境是否正常 1.先在