Created
September 3, 2020 15:26
-
-
Save Akhi1/9af39b0bb50771b7fe1eede5a3018b3c to your computer and use it in GitHub Desktop.
Steps to run Kafka in a Windows PC along with Creating a Topic, Publishing to and Consuming a Topic and Deleting logs
This file contains hidden or 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
Original Documentation for download and steps: | |
https://kafka.apache.org/quickstart | |
Download latest version of kafka server: | |
https://www.apache.org/dyn/closer.cgi?path=/kafka/ | |
================================================== | |
Download and extract kafka to any directory (mine is installed in C:\kafka) | |
Open command prompt from within this folder ('kafka' in my case) | |
That's it. Execute the following respective commands. | |
================================================== | |
#run zookeeper | |
bin\windows\zookeeper-server-start.bat config\zookeeper.properties | |
#run kafka server | |
bin\windows\kafka-server-start.bat config\server.properties | |
#create topic | |
bin\windows\kafka-topics.bat --create --topic <topicname> --bootstrap-server localhost:9092 | |
#view topic stats | |
bin\windows\kafka-topics.bat --describe --topic <topicname> --bootstrap-server localhost:9092 | |
#publish to topic | |
bin\windows\kafka-console-producer.bat --topic <topicname> --bootstrap-server localhost:9092 | |
#consume from topic | |
bin\windows\kafka-console-consumer.bat --topic <topicname> --from-beginning --bootstrap-server localhost:9092 | |
#delete topic logs | |
rm -rf \logs\kafka-logs \logs\zookeeper | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment