Windows Kafka configuration > startup tutorial

Time:2020-11-22

Windows Kafka startup tutorial

Modification boker.id And log.dirs

Enter Kafka directory, create new folder Kafka logs and folder ZK dir, enter config directory, open server.properties

broker.id=1
log.dirs=../kafka-logs

Modification zookeeper.properties

Find datadirs and change to

dataDir=../zk-dir

Start zookeeper

Use PowerShell or CMD or git bash to open it to the directory where Kafka is installed. Paste the command and execute it

bin/windows/zookeeper-server-start.bat config/zookeeper.properties

Start Kafka

Re open a PowerShell or CMD or git bash again, and CD it to Kafka’s installation directory. Type in the command.

bin/windows/kafka-server-start.bat    config/server.properties

Start up complete

Create topic

Create the topic of test

bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic merchants-template

View topic

bin/windows/kafka-topics.bat --list --zookeeper localhost:2181

Start producers

bin/windows/kafka-console-producer.bat --broker-list localhost:9092 --topic merchants-template

Creating consumers

bin/windows/kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic merchants-template --from-beginning

If you are nameless, concentrate on practicing sword!
Like friends can leave your praise!