Flume

安装Flume 1.6.0-cdh5.7.0

配置环境变量

export FLUME_HOME=/root/app/apache-flume-1.6.0-cdh5.7.0-bin
export PATH=$FLUME_HOME/bin:$PATH

配置Flume JAVA_HOME

/root/app/apache-flume-1.6.0-cdh5.7.0-bin/conf
/flume-env.sh
export JAVA_HOME=/usr/local/jdk8

配置 conf

A) 配置Source
B)配置 Channnel
C)配置 Sink
D) 把以上三个组件串起来


# Define a memory channel called ch1 on agent1
agent1.channels.ch1.type = memory
 
# Define an Avro source called avro-source1 on agent1 and tell it
# to bind to 0.0.0.0:41414. Connect it to channel ch1.
a1.sources.avro-source1.channels = ch1
a1.sources.avro-source1.type = avro
a1.sources.avro-source1.bind = 0.0.0.0
a1.sources.avro-source1.port = 41414
 
# Define a logger sink that simply logs all events it receives
# and connect it to the other end of the same channel.
a1.sinks.log-sink1.channel = ch1
a1.sinks.log-sink1.type = logger
 
# Finally, now that we've defined all of our components, tell
# agent1 which ones we want to activate.
a1.channels = ch1
a1.sources = avro-source1
a1.sinks = log-sink1
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
 
# Define source

a1.sources.r1.type = netcat
a1.sources.r1.bind = lixinxin
a1.sources.r1.port = 44444

# Define sink
a1.sinks.k1.type = logger

#Define a memory channel called ch1 on agent1
a1.channels.c1.type = memory

#Bind the source and sink to channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

启动agent

flume-ng agent \
--name a1 \
--conf $FLUME_HOME/conf \
--conf-file $FLUME_HOME/conf/example.conf \
-Dflume.root.logger=INFO,console
flume配置agent.png

启动flume.png

停止 flume

ps -ef|grep flume
 kill -9 pid
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 博客原文 翻译作品,水平有限,如有错误,烦请留言指正。原文请见 官网英文文档 引言 概述 Apache Flume...
    rabbitGYK阅读 11,538评论 13 34
  • 介绍 概述 Apache Flume是为有效收集聚合和移动大量来自不同源到中心数据存储而设计的可分布,可靠的,可用...
    ximengchj阅读 3,548评论 0 13
  • 1. Flume简介 Apache Flume是一个分布式的、可靠的、可用的,从多种不同的源收集、聚集、移动大量日...
    奉先阅读 4,512评论 2 5
  • Flume的功能和架构特点 ** 功能 **flume 是一个分布式的,可靠的,可用的,可以非常有效率的对大数据的...
    心_的方向阅读 2,533评论 1 10
  • 1 我的大学生活之大学英语学习 1) 在这个学期的大学英语学习中,我的GPS [Gains] 收获了一些知识,最起...
    hyxzc阅读 240评论 4 1