Kafka(6)How to Monitor Kafka

本文介绍了Kafka监控工具KafkaOffsetMonitor和kafka-web-console的使用方法,包括如何通过命令行构建、运行并理解其内部工作原理。此外,文章还提供了一个网页访问示例,演示了如何实时查看Kafka集群的偏移量信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Kafka(6)How to Monitor Kafka

1. KafkaOffsetMonitor

This project is good.
https://github.com/quantifind/KafkaOffsetMonitor

build and run it
>sbt clean update
>sbt assembly
>java -cp target/scala-2.10/KafkaOffsetMonitor-assembly-0.2.1-SNAPSHOT.jar com.quantifind.kafka.offsetapp.OffsetGetterWeb --zk ubuntu-slave1 --port 8080 --refresh 10.seconds --retain 2.days

Visit the web page 
http://localhost:8080

The most import class is something like com.quantifind.kafka.OffsetGetter.
It keeps using import kafka.utils.ZkUtils to connect to the zookeeper to fetch the information.

2. kafka-web-console
This project is here
https://github.com/claudemamo/kafka-web-console.git

build and run it
>git clone https://github.com/claudemamo/kafka-web-console.git

>sbt clean update gen-idea
>sbt run

Visit the page http://localhost:9000

It is using the com.twitter.zk.ZkClient to fetch the information from zookeeper.

If I plan to writer something myself. I need to understand this tool.

https://cwiki.apache.org/confluence/display/KAFKA/Kafka+data+structures+in+Zookeeper

References:
https://github.com/quantifind/KafkaOffsetMonitor

https://github.com/claudemamo/kafka-web-console



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值