Windows Standalone Configuration Kafka environment

Source: Internet
Author: User

First make sure the machine is installed Zookeeper,zookeeper installation reference Windows standalone configuration zookeeper environment

Then make sure the zookeeper is in the normal boot state

Download Kafka

Http://kafka.apache.org/downloads.html

Download binary Package

Unzip after download, I extracted here to the D:\WorkSoftware\kafka_2.11_0.10.1.0 directory

Unzip

First create an empty folder logs

Create a Logs folder

Go to config directory, edit server.properties file

Edit Server.properties

Modify the address of the log.dirs attribute section

Modifying the Log.dirs Property

Then in the D:\WorkSoftware\kafka_2.11_0.10.1.0 directory, press and hold shift+ right mouse button

Open a command Window here

Then enter the following command

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

Enter, execute command

Error occurred

If an error occurs, I analyze here that Classpath is not configured correctly, then set Classpath first, then execute

CLASSPATH=.;
Set Classpath success

To test, first enter the D:\WorkSoftware\kafka_2.11-0.10.1.0\bin\windows directory and then open the Command window in the current directory

Enter the following command to create a topic

kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test.topic

If you also encounter errors such as the inability to load classes, set the Classpath first

Encountered unable to load main class, need to set Classpath topic creation succeeded

Open a producer

kafka-console-producer.bat --broker-list localhost:9092 --topic test.topic
Execute command, open producer

These three windows do not close the case (Zookeeper/kafka/producer), open a command window again (or in the Kafka directory right-click), enter the following command, open consumer

kafka-console-consumer.bat --zookeeper localhost:2181 --topic test.topic

This way, there are 4 command windows

respectively is

    1. Zookeeper
    2. Kafka
    3. Producer
    4. Consumer

Below, we enter some characters in Window # 3rd (Producer), and we'll see window 4th and we'll get a message.

So far, Kafka's Windows stand-alone environment has been built



Sphsyv
Links: https://www.jianshu.com/p/64d25dcf8300
Source: Pinterest
The copyright of the book is owned by the author, and any form of reprint should be contacted by the author for authorization and attribution.

Windows Standalone Configuration Kafka environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.