Flume 的监控方式

因为Flume是基于Java编写的,所以已经提供了基于JMX的服务实现,内置了MBean。

唯一需要做的就是启动JMX服务,使用工具,或写代码,向JMX的monitor服务发送请求,获取其中的MBean。

一、基于JCONSOLE查看MBean

1、在conf/flume.env.sh中进行配置

export JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=5445 -Dcom.sun.man
agement.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

2、运行agent

3、打开jconsole工具,在远程连接那输入主机名及端口号

 

 二、基于Json的监控

1、在conf/flume.env.sh中进行配置或者在启动命令中加入“-Dflume.monitoring.type=http -Dflume.monitoring.port=34545”

export JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=5445 -Dcom.sun.man
agement.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
-Dflume.monitoring.type=http -Dflume.monitoring.port=34545

2、启动agent

3、打开浏览器,登录34545端口查看Json代码

原文地址:https://www.cnblogs.com/yangxusun9/p/12490094.html