Last active
November 11, 2022 14:08
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create topics | |
kafka-topics.sh --create \ | |
--zookeeper m01.itversity.com:2181,m02.itversity.com:2181,w01.itversity.com:2181 \ | |
--replication-factor 1 \ | |
--partitions 1 \ | |
--topic kafkadg | |
# List all topics | |
kafka-topics.sh --list \ | |
--zookeeper m01.itversity.com:2181,m02.itversity.com:2181,w01.itversity.com:2181 | |
# List one topic | |
kafka-topics.sh --list \ | |
--zookeeper m01.itversity.com:2181,m02.itversity.com:2181,w01.itversity.com:2181 \ | |
--topic kafkadg | |
kafka-topics.sh --delete \ | |
--zookeeper m01.itversity.com:2181,m02.itversity.com:2181,w01.itversity.com:2181 \ | |
--topic testdg | |
# Command to produce messages, start typing after running this kakfa-console-producer command | |
# The messages will be stored in topic kafkadg on the host where brokers are running | |
kafka-console-producer.sh \ | |
--broker-list w01.itversity.com:9092,w02.itversity.com:9092,w03.itversity.com:9092 \ | |
--topic kafkadg | |
# Open another shell and then run kafka-console-consumer command to see streaming messages | |
kafka-console-consumer.sh \ | |
--bootstrap-server w01.itversity.com:9092,w02.itversity.com:9092,w03.itversity.com:9092 \ | |
--topic kafkadg \ | |
--from-beginning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment