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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM