zoukankan      html  css  js  c++  java
  • Flume NetCat Demo

    准备工作:

      1.apache官网下载flume

      2.解压flume

      3.修改flume-env.sh,配置JAVA_HOME


    NetCat采集Demo:

      1.在conf中创建netcat-logger.conf

    # 定义这个agent中各组件的名字
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1
    
    # 描述和配置source组件:r1
    a1.sources.r1.type = netcat
    a1.sources.r1.bind = localhost
    a1.sources.r1.port = 44444
    
    # 描述和配置sink组件:k1
    a1.sinks.k1.type = logger
    
    # 描述和配置channel组件,此处使用是内存缓存的方式
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100
    
    # 描述和配置source  channel   sink之间的连接关系
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1

      2.启动agent采集数据

    bin/flume-ng agent -c conf -f conf/netcat-logger.conf -n a1  -Dflume.root.logger=INFO,console

      -c conf   指定flume自身的配置文件所在目录

      -f conf/netcat-logger.con  指定我们所描述的采集方案

      -n a1  指定我们这个agent的名字

      3.测试

      telnet localhost 44444

  • 相关阅读:
    Educational Codeforces Round 80 (Rated for Div. 2)
    寒假集训
    HDU-4609 3-idiots
    部分分式展开法
    线性同余方程组
    爬取哔哩哔哩python搜索结果
    数据可视化练习题
    python正则表达式
    git的安装和基础知识
    python学习计划
  • 原文地址:https://www.cnblogs.com/0xcafedaddy/p/6756695.html
Copyright © 2011-2022 走看看