首页 > 其他 > 详细

kafka监控

时间:2014-12-17 17:54:17      阅读:1642      评论:0      收藏:0      [点我收藏+]

做kafka相关项目,需要用到监控的东东,找到了两个方法

第一个:

http://quantifind.com/KafkaOffsetMonitor/

非常容易上手,效果也直观,可以显示各个topic consumer的offset broker存储log的长度

不过发现一个bug就是当 consumer没有commit offset的时候 这个topic就不会显示它的消费情况

使用方法就是直接启动一个jar包 配好zookeeper就好了

bubuko.com,布布扣

第二个比较直接:就是kafka直接提供jmx接口进行监控

首先需要把jmx打开 方法参照了:

http://blogs.impetus.com/big_data/big_data_technologies/kafka-monitoring-using-jmx-jmxtrans.do

Step-I: Setup JMXTrans on all the machines of the Kafka cluster as done on the Storm cluster in the previous post.
Step-II: In the kafka setup, edit “kafka-run-class.sh” script file by adding the following line to it:
KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
Step-III: Also, edit the “kafka-server-start.sh” script file present in the kafka setup to set the JMX port to 9999 by adding the following line:
export JMX_PORT=${JMX_PORT:-9999}                                    
apache的wiki推荐了四种jmx reporter
本人实践中采用了jmxtrans 就是将jmx的信息以json格式汇报出来 比较好方便集成到现有的监控系统当中

 

kafka监控

原文:http://www.cnblogs.com/chenatu/p/4169597.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!