zoukankan      html  css  js  c++  java
  • Flume案例(2)

    1) Exec

    • 创建agent配置文件

    # > vi /home/bigdata/flume/conf/exec_tail.conf

    添加以下内容:

    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/data/log_exec_tail

    # 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 agent a1
    • # > flume-ng agent -c . -f /home/bigdata/flume/conf/exec_tail.conf -n a1 -Dflume.root.logger=INFO,console

    • 制作log_exec_tail文件

    # > echo "exec tail 1" >> /home/data/log_exec_tail

    • master的控制台,可以看到以下信息:

     

    • log_exec_tail文件中追加数据

    # > echo "exec tail 2" >> /hadoop/flume/log_exec_tail

    • master的控制台,可以看到以下信息:

     

    # for i in {1..100}

    > do echo "flume +" $i >> /home/data/log_exec_tail

    > done

  • 相关阅读:
    js项目结合的注意点
    cookie练习
    json记载字符个数
    js,jQuery获取标签
    新人签到
    使用Resources类搭建Unity简单的资源管理工具类
    初识vue
    原生JS写出贪吃蛇
    用js做一个简单的班级点名器
    Javascript 的"循环语句"
  • 原文地址:https://www.cnblogs.com/wxk161640207382/p/10862440.html
Copyright © 2011-2022 走看看