consumer (1)

💻 Programming

Apache Kafka 운영 팁

Kafka 운영시 유용한 명령어

토픽 목록 조회

bin/kafka-topics.sh --zookeeper localhost:2181 --list

 

토픽 상세 조회

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

 

토픽 삭제

bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic mytopic  (JRE 7 사용시 confluent-3.0.0 사용)

 

토픽 내 메시지 개수 조회 ???

bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic --time -1 --offsets 1 | awk -F ":" '{sum += $3} END {print sum}'

 

토픽 내 earliest 오프셋 조회

bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic --time -2

 

토픽 내 최신 오프셋 조회

bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic mytopic --time -1

 

콘솔 명령어로 메시지 컨숨하기

bin/kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic mytopic --from-beginning

 

 

아파치 카프카 컨수머 멀티쓰레드로 돌리기 위한 팁

 

 

 

참고문서 : gist.github.com/ursuad/e5b8542024a15e4db601f34906b30bb5