【问题标题】:How to monitor Apache Flume agents status?如何监控 Apache Flume 代理状态?
【发布时间】:2019-08-19 10:47:29
【问题描述】:

我知道企业(例如 Cloudera)的方式,通过使用 CM(通过浏览器)或 Cloudera REST API 可以访问监控和配置设施。

但是如何安排(运行和重新运行)flume 代理的生命周期,并在没有 CM 的情况下监控它们的运行/失败状态? Flume 发行版中有这样的东西吗?

【问题讨论】:

    标签: flume flume-ng


    【解决方案1】:

    Flume 的 JSON 报告 API 可用于监控运行状况和性能。 Link

    【讨论】:

      【解决方案2】:

      我尝试在开始时将flume.monitoring.type/port 添加到flume-ng。它完全符合我的需求。

      例如,让我们创建一个简单的代理a1。它监听localhost:44444 并作为接收器登录到控制台:

      # flume.conf
      a1.sources = s1
      a1.channels = c1
      a1.sinks = d1
      
      a1.sources.s1.channels = c1
      a1.sources.s1.type = netcat
      a1.sources.s1.bind = localhost
      a1.sources.s1.port = 44444
      
      a1.sinks.d1.channel = c1
      a1.sinks.d1.type = logger
      
      a1.channels.c1.type = memory
      a1.channels.c1.capacity = 100
      a1.channels.c1.transactionCapacity = 10
      

      使用附加参数运行它flume.monitoring.type/port:

      flume-ng agent -n a1 -c conf -f flume.conf -Dflume.root.logger=INFO,console -Dflume.monitoring.type=http -Dflume.monitoring.port=44123
      

      然后在浏览器localhost:44123/metrics监控输出

      {"CHANNEL.c1":{"ChannelCapacity":"100","ChannelFillPercentage":"0.0","Type":"CHANNEL","EventTakeSuccessCount":"570448","ChannelSize":"0","EventTakeAttemptCount":"570573","StartTime":"1567002601836","EventPutAttemptCount":"570449","EventPutSuccessCount":"570448","StopTime":"0"}}
      

      只是尝试一些负载:

      dd if=/dev/urandom count=1024 bs=1024 | base64 | nc localhost 44444
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-04-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-05-18
        • 2019-04-10
        • 1970-01-01
        相关资源
        最近更新 更多