Example of getting Started with Windows Kafka configuration

Source: Internet
Author: User
Tags zookeeper

Experimental platform and Software:

Operating system: Windows7 32-bit

Java Development Package: jdk1.8.0_144

Cluster: zookeeper-3.3.6

Message Queuing: kafka_2.11-0.11.0.1

Installation sequence:

1. JDK Installation Pre-configuration

Jdk-8u144-windows-i586_8.0.1440.1.exe

Click Install: "Next" ...

Environment variable configuration:

1) Computer/Properties/Advanced system settings/Advanced/environment variable, new variable in system variable: Java_home value:C:\Program

files\java\jdk1.8.0_144 (adjusted according to installation path)

2) New variable: Classpath, Value:.; %java_home%\lib;%java_home%\lib\tools.jar

3) Finally in the system variable: Path value after adding: %java_home%\bin;%java_home%\jre\bin;

Test

Open cmd Command Window input: java-version

Enter execution if the Java version is displayed correctly the installation configuration is successful

Note:

1) Multiple environment variable values are separated by semicolons

2) The Classpath value is preceded by a small dot

2. Zookeeper Installation Configuration

1) Compressed Package decompression: zookeeper-3.3.6

2) New Data folder under Directory

3) Conf directory, then copy zoo_sample.cfg to zoo.cfg

4) Modify the Datadir=d:\zookeeper-3.3.6\zookeeper-3.3.6\data in Zoo.cfg

(according to the decompression path to adjust accordingly)

3. Start Zookeeper

go to the bin directory and execute Zkserver.cmd

Open command Window in Bin directory: SHIFT + right mouse button

Input: Zkserver.cmd Enter execution

4 Kafka Configuration

Compressed Package Decompression: D:\kafka_2.11-0.11.0.1

Go to config directory, edit server.properties file

Log.dirs=d:\kafka_2.11-0.11.0.1\logs

Execute the cmd command under path D:\kafka_2.11-0.11.0.1:
.\bin\windows\kafka-server-start.bat .\config\server.properties

在路径bin\window下
1)创建 topic :
kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test.topic
2) 创建 producer:
kafka-console-producer.bat --broker-list localhost:9092 --topic test.topic

3) 创建 consummer:
kafka-console-consumer.bat --zookeeper localhost:2181 --topic test.topic

5 测试
下面,我们在窗口(Producer)输入一些字符,就会看到
consummer窗口马上就收到消息。

Example of getting Started with Windows Kafka configuration

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.