Install Kafka on window

Source: Internet
Author: User

Installing Zookeeper

Kafka operation requires a jdk+zookeeper environment to be able to use, JDK installation and environment variable configuration is not introduced here, you need to install zookeeper. Can be downloaded from the official website Https://www.apache.org/dyn /closer.cgi/zookeeper/

    • Unzip the downloaded package and change the zoo_sample.cfg to zoo.cfg in the Conf directory.

    • After opening zoo.cfg will change the path of the datadir inside, I change here to the following

      Datadir=e:\\data\\logs\\zookeeper
    • The zookeeper is then fitted to the environment variable, and its configuration is similar to the JDK configuration

    • Run zookeeper, the cmd inside the input zkserver will appear below is the installation success

Installing Kafka

Kafka:http://kafka.apache.org/downloads

  • Unzip the downloaded installation package and go to the Conf directory to find the Server.properties file

  • Find and edit

    Log.dirs=e:\\data\\logs\\kafka
    zookeeper.connect=localhost:2181
  • Then go to the Kafka directory to execute the following command, you can use the blank space in the folder to press SHIFT and right -click to Open the command window

    . \bin\windows\kafka-server-start.bat. \config\server.properties
    ?
    Every time you run Kafka, you have to turn this and the zkserver on.
  • You can then test to create a topic

    . \bin\windows\kafka-topics.bat--create--zookeeper localhost:2181--replication-factor 1--partitions 1--topic test
  • After opening the producer, go to the Bin/windows directory using the command window

    . \kafka-console-producer.bat--broker-list localhost:9092--topic test

  • Open the consumer and go to the Bin/windows directory using the command window

    . \kafka-console-consumer.bat--zookeeper localhost:2181--topic test
  • After that, you can enter some information at the Producer's window, and then you can see the input information on the consumer's side.

Install Kafka on window

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.