๐Ÿ’ป 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