码迷,mamicode.com
首页 > Web开发 > 详细

flume实战

时间:2019-09-28 23:11:36      阅读:122      评论:0      收藏:0      [点我收藏+]

标签:etc   data   exec   nod   启动   single   flume-ng   skin   logger   

flume 三大组件

source 收集

channel 聚集

sink 输出

 

使用Flume关键就是写配置文件

A 配置source

B 配置channel

C 配置sink

D 把以上3个组件串起来

 

1.通过IP端口 接收数据

  

a1 agent名称
r1 数据源名称
k1 sinks名称
c1 channel名称
 
# example.conf: A single-node Flume configuration

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind =hadoop000
a1.sources.r1.port = 44444 # Describe the sink a1.sinks.k1.type = logger # Use a channel which buffers events in memory a1.channels.c1.type = memory # Bind the source and sink to the 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.roog.logger=INFO,console

 

agent选型 : exec source+ memory channel + logger skin

# Name the components on this agent

a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = exec
a1.sources.r1.command=tail -f /home/hadoop/data/data.log
a1.sources.r1.shell=/bin/sh -c

# Describe the sink
a1.sinks.k1.type = logger

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

 

flume实战

标签:etc   data   exec   nod   启动   single   flume-ng   skin   logger   

原文地址:https://www.cnblogs.com/yeqian100/p/11605235.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!