Kafka(6)How to Monitor Kafka

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



猜你喜欢

转载自sillycat.iteye.com/blog/2108042