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代码

posted @ 2020-03-14 00:12  可以看看你胖次吗  阅读(1511)  评论(0编辑  收藏  举报
Live2D