温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

flume的几种使用方式

发布时间:2020-07-04 02:51:12 来源:网络 阅读:440 作者:moviebat 栏目:大数据

    近期,听了王家林老师的2016年大数据Spark“蘑菇云”行动,需要将flume,kafka和Spark streaming进行整合。感觉一时难以上手,先从简单着手吧:


一、netcat方式+Logger日志显示


Flume 配置文件如下:

# 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 = localhost
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
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

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

flume的启动:

$ bin/flume-ng agent --conf conf --conf-file example.conf --name a1 -Dflume.root.logger=INFO,console

触发数据:

telnet localhost 44444

会在flume的控制台出现同样的字符。


二、flume级联方式

通过avro,在两台机器间传送数据,源头为netcat


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI