前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >flume配置实例

flume配置实例

作者头像
用户2936342
发布2018-08-27 14:27:20
4660
发布2018-08-27 14:27:20
举报
文章被收录于专栏:nummynummy

Flume agent的配置保存在配置文件中,同一个文件中可以同时配置多个agent。每个agent都需要配置source、channel、sink的信息。

配置文件

配置文件编写的步骤:

  • 从整体上描述代理agent中sources、sinks、channels所涉及到的组件
代码语言:javascript
复制
    # Name the components on this agent
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1
  • 详细描述agent中每一个source、sink与channel的具体实现
代码语言:javascript
复制
    # 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
  • 通过channel将source与sink连接起来
代码语言:javascript
复制
    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1

启动服务

输入以下命令:

代码语言:javascript
复制
flume-ng  agent -n a1  -c  ../conf   -f  ../conf/example.file   
-Dflume.root.logger=DEBUG,console  

参数说明:

  • -n 指定agent名称(与配置文件中代理的名字相同)
  • -c 指定flume中配置文件的目录
  • -f 指定配置文件
  • -Dflume.root.logger=DEBUG,console 设置日志等级

发送数据

使用telnet发送数据:

image.png

然后再flume控制台就可以看到输出的结果:

image.png

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017.04.28 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 配置文件
  • 启动服务
  • 发送数据
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档