Kafdrop是Apache Kafka的开源Web UI可视化工具。
主要功能
- 查看Kafka代理 -主题和分区分配以及控制器状态
- 查看主题 -分区数,复制状态和自定义配置
- 浏览消息 -JSON,纯文本和Avro编码
- 查看消费者组 -每个分区的停放偏移量,合并延迟和每个分区滞后
- 创建新主题
- 查看ACL
编排文件
[administrator@JavaLangOutOfMemory luga]% vi docker-compose-kafdrop.yml version: "2" services: kafdrop: image: obsidiandynamics/kafdrop restart: "no" ports: - "9000:9000" environment: KAFKA_BROKERCONNECT: "kafka:29092" JVM_OPTS: "-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify" depends_on: - "kafka" kafka: image: obsidiandynamics/kafka restart: "no" ports: - "2181:2181" - "9092:9092" environment: KAFKA_LISTENERS: "INTERNAL://:29092,EXTERNAL://:9092" KAFKA_ADVERTISED_LISTENERS: "INTERNAL://kafka:29092,EXTERNAL://localhost:9092" KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT" KAFKA_INTER_BROKER_LISTENER_NAME: "INTERNAL" KAFKA_ZOOKEEPER_SESSION_TIMEOUT: "6000" KAFKA_RESTART_ATTEMPTS: "10" KAFKA_RESTART_DELAY: "5" ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: "0"
启动服务
[administrator@JavaLangOutOfMemory luga]% docker-compose -f docker-compose-kafdrop.yaml up -d
访问web页面 http://ip:9000
模拟生产者生产消息
bash-4.4# ./kafka-console-producer.sh --broker-list localhost:9092 --topic FLINK_TO_TASK_PROD >'Merchant-2020-001' Values:'111111111111100000000000000','MerID:20200202020202' >'Merchant-2020-001' Values:'111111111111100000000000000','MerID:20200202020203' >'Merchant-2020-001' Values:'111111111111100000000000000','MerID:20200202020205' >'Merchant-2020-001' Values:'111111111111100000000000000','MerID:20200202020208' >'Merchant-2020-001' Values:'111111111111100000000000000','MerID:20200202020200' >'Merchant-2020-001' Values:'111111111111100000000000000','MerID:20200202020207' >
查看及检索消息