• Flume 知识点(六)Flume 的监控


    简述

    使用 Flume 实时收集日志的过程中,尽管有事务机制保证数据不丢失,但仍然需要时刻关注 Source、Channel、Sink 之间的消息传输是否正常。
    比如,SouceChannel 传输了多少消息,ChannelSink 又传输了多少,两处的消息量是否偏差过大等等。

    Flume 为我们提供了 Monitor 的机制:http://flume.apache.org/FlumeUserGuide.html#monitoring 通过Reporting 的方式,把过程中的Counter都打印出来。

    类型

    • JMX Reporting
    • Ganglia Reporting
    • JSON Reporting
    • Custom Reporting

    Ganglia Reporting

    Flume 可以报告它的 metrics 到 ganglia3,只要你在启动 Flume agent 的时候设置一些参数即可,也可以把这些参数设置在 flume-env.sh 配置文件中。需要设置的参数如下,这些参数的前缀如下Flume.monitoring:

    • -Dflume.monitoring.type:类型必须是ganglia
    • -Dflume.monitoring.pollFrequency: 默认值是60秒,flume向ganglia报告metrics的时间间隔
    • -Dflume.monitoring.isGanglia3: 默认是false,ganglia server的版本在3以上,flume 发送的是ganglia3.1的数据格式

    启动flume Agent:

    $ bin/flume-ng agent --conf-file example.conf --name a1 -Dflume.monitoring.type=ganglia -Dflume.monitoring.hosts=com.example:1234,com.example2:5455
    

    JSON Reporting

    Flume 也可以报告 JSON 格式的 report,为了开启 JSON report,在 Flume 机器上启动了一个 web server。需要在客户端启动时设置以下参数:
    type 该组件的名称,这里设置为http
    port 该服务监听的端口,默认是41414

    启动flume Agent:

    flume-ng agent --conf-file example.conf --name a1 -Dflume.monitoring.type=http -Dflume.monitoring.port=34545
    

    然后通过http://:/metrics来查看值

    作者:studytime
    原文:https://www.studytime.xin/

  • 相关阅读:
    nginx部分功能配置备忘
    mysql 截取数据 组合排序
    java实现排列组合
    每日记载内容总结48
    http请求转换为https请求
    每日记载内容总结47
    rabbitmq 基本操作
    redis免密登录被入侵解决方式
    支付宝支付sign_type从RSA到RSA2遇到的问题
    Java面试题2
  • 原文地址:https://www.cnblogs.com/studytime/p/11644063.html
Copyright © 2020-2023  润新知