重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

flume的几种使用方式-创新互联

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

我们提供的服务有:成都做网站、成都网站制作、成都外贸网站建设、微信公众号开发、网站优化、网站认证、新疆ssl等。为成百上千企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的新疆网站制作公司

一、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

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页名称:flume的几种使用方式-创新互联
文章转载:http://cqcxhl.com/article/diesgi.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP