Skip to content

simple java app for monitoring kafka logdir growing

Notifications You must be signed in to change notification settings

Courouge/kafka-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Start docker platform

docker-compose up -d zookeeper-1 zookeeper-2 zookeeper-3
docker-compose up kafka-1 kafka-2 kafka-3

Dev java kadmin

docker-compose up --build -d kadmin && docker-compose logs -f kadmin

zookeeper

 docker-compose exec zookeeper-1 bash -c 'echo stat |nc zookeeper-1 2181'

kafka

  • List topics
docker-compose exec kafka-1 bash -c 'KAFKA_OPTS="" kafka-topics --describe --zookeeper zookeeper-1:2181'
  • Create demo-perf-topic with 4 partitions and 3 replicas.
docker-compose exec kafka-1 bash -c 'KAFKA_OPTS="" kafka-topics --create --partitions 4 --replication-factor 3 --topic demo-perf-topic --zookeeper zookeeper-1:2181'
  • Produces random messages on demo-perf-topic
docker-compose exec kafka-1 bash -c 'KAFKA_OPTS="" kafka-producer-perf-test --throughput 500 --num-records 100000000 --topic demo-perf-topic --record-size 100 --producer-props bootstrap.servers=localhost:9092'
  • Consumes random messages on demo-perf-topic
docker-compose exec kafka-1 bash -c 'KAFKA_OPTS="" kafka-consumer-perf-test --messages 100000000 --threads 1 --topic demo-perf-topic --broker-list localhost:9092 --timeout 60000'
  • Add acls on Test-topic
docker-compose exec kafka-1 bash -c 'KAFKA_OPTS="" kafka-acls --authorizer kafka.security.auth.SimpleAclAuthorizer --authorizer-properties zookeeper.connect=zookeeper-1:2181 --add --allow-principal User:test --topic Test-topic'
  • List acls on cluster
docker-compose exec kafka-1 bash -c 'KAFKA_OPTS="" kafka-acls --authorizer kafka.security.auth.SimpleAclAuthorizer --authorizer-properties zookeeper.connect=zookeeper-1:2181 --list'
  • Produce random message kafka with sasl_plaintext
docker-compose exec kafka-1 bash -c 'KAFKA_OPTS="" kafka-producer-perf-test --throughput 500 --num-records 100000000 --topic demo-perf-topic --record-size 100 --producer-props bootstrap.servers=kafka-1:9092 --producer.config=/etc/kafka/secrets/producer.properties'

Mongodb

  • Connect to server
docker-compose exec mongodb bash -c 'mongo admin -u root -p rootpassword'
  • Basics command
show dbs
show collections

use kafkamonitor
db.topics.find()
  • Data Structure Exemple
{ "_id" : "5e9c5e6007b9401756553735", "cluster" : "Cluster_100", "topic" : "__confluent.support.metrics", "size" : "11367", "time" : "2020-04-19T14:21:20.052Z" }

About

simple java app for monitoring kafka logdir growing

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published