개성있는 개발자 되기

카프카 명령어 본문

Open Source/Kafka

카프카 명령어

정몽실이 2020. 4. 1. 14:31

| 토픽 정보 확인

kafka-topics.sh --describe --zookeeper peter-zk001:2181 --topic peter
Topic:peter PartitionCount:6 ReplicationFactor:1 Configs:
Topic: peter Partition: 0 Leader: 2 Replicas: 2 Isr: 2
Topic: peter Partition: 1 Leader: 3 Replicas: 3 Isr: 3
Topic: peter Partition: 2 Leader: 1 Replicas: 1 Isr: 1
Topic: peter Partition: 3 Leader: 2 Replicas: 2 Isr: 2
Topic: peter Partition: 4 Leader: 3 Replicas: 3 Isr: 3
Topic: peter Partition: 5 Leader: 1 Replicas: 1 Isr: 1

 

| 토픽의 현재 offset 확인

kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list 카프카브로커 --topic 토픽명

 

| 모든 컨슈머 그룹 리스트

kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list

 

| 컨슈머 상태와 Offset확인

kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group 컨슈머그룹명 --describe
GROUP TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID HOST CLIENT-ID
item-ITEM-price-consumer item-TABLE-item 9 2812 2812 0 - - -
item-ITEM-price-consumer item-TABLE-item 8 2814 2814 0 - - -
item-ITEM-price-consumer item-TABLE-item 7 2809 2809 0 - - -
item-ITEM-price-consumer item-TABLE-item 6 2810 2810 0 - - -
item-ITEM-price-consumer item-TABLE-item 5 2811 2811 0 - - -
item-ITEM-price-consumer item-TABLE-item 4 2813 2813 0 - - -
item-ITEM-price-consumer item-TABLE-item 3 2814 2814 0 - - -
item-ITEM-price-consumer item-TABLE-item 2 2813 2813 0 - - -
item-ITEM-price-consumer item-TABLE-item 1 2811 2811 0 - - -
item-ITEM-price-consumer item-TABLE-item 0 2813 2813 0 - - -

 

| 컨슈머 그룹 삭제

kafka-consumer-groups.sh --zookeeper localhost:2181 --delete --group <group_name>
Comments