Introduction
Windows installation guide for https://kafka.apache.org/quickstart
Step 1: Downloading the Application
- Official download page - https://kafka.apache.org/downloads
- Choose the latest version: kafka_2.13-3.5.1.tgz (Current)
Step 2: Installation
- Extract the Downloaded file (.tgz) with any file archiver like 7zip
- After extracting you'll get a TAR File (.tar), Again extract the TAR file.
Step 3: Configuration
-
Update server.properties
- Create new Directory - C:\tmp\kafka-logs
- Update log.dirs=C:\tmp\kafka-logs
-
Update zookeeper.properties
- Create new Directory - C:\tmp\zookeeper
- Update _*dataDir*=C:\tmp\zookeeper_
Step 4: Running the Kafka Application
Kafka with ZooKeeper
- Start Zookeeper Server
.\bin\windows\zookeeper-server-start.bat config\zookeeper.properties
- Start Kafka Server
.\bin\windows\kafka-server-start.bat config\server.properties
Step 5: Create Topic
- Topic name: quickstart-events
.\bin\windows\kafka-topics.bat --create --topic quickstart-events --bootstrap-server localhost:9092
Step 6: Producer: Write some events to topic
.\bin\windows\kafka-console-producer.bat --topic quickstart-events --bootstrap-server localhost:9092
Step 7: Consumer: Read the events
.\bin\windows\kafka-console-consumer.bat --topic quickstart-events --from-beginning --bootstrap-server localhost:9092
Step 8: Stream messages
- Add a message in Producer console from Step 6
- Message is streamed to the Consumer console from Step 7
Top comments (0)