因为Flume是基于Java编写的,所以已经提供了基于JMX的服务实现,内置了MBean。
JMX服务,使用工具,或写代码,向JMX的monitor服务发送请求,获取其中的MBean。
一、
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的监控
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