Install Kafka on Windows
How to Install Apache Kafka on Windows?
With this article, we shall be learning how to install Kafka on Windows. As we know, Kafka is an open-source, distributed system that is utilized and implemented for real-time data streaming organizations for seamless work with their big data products. Kafka works on the publish-subscribe, pull-based messaging approach.
With Kafka, the user can easily push the record to the publisher which takes it up and transfer it via the Kafka brokers, and until a pull request is received by the consumer the message stays in the log commit Kagfka till the retention period. Once a subscriber asks for the message Kafk pushes the message to the consumer and during the entire process, Zookpeer helps to monitor and manage the Kafka broker.
To learn more about Kafka, you deep dive into the What is Kafka and explore the core concepts around it.
Pre-requisites
Some pre-requisites that must be kept in mind before starting to install Kafka on Windows:
Java Development Kit (JDK): Before installing Kafka on your system, it's recommended to have Java as the most needed prerequisite. It can directly be installed via the official Oracle website or from the link JDK. Make sure to install 32-bit or 64-bit as per your system configuration.
Once it's downloaded, run the installer, and you should be easily able to configure the file path as well as the Java_Home environment variables Lastly, run the java-version command to test the JDK installation in your terminal.
7-Zip or WinRAR: For unzipping or extracting the downloaded Kafa files, it is good to have the 7-Zip already installed. You can install it via the link 7-Zip or WinRAR.
Steps to Install Kafka on Windows
Let us get started installing Kafka on Windows. Although downloading Kafka for a Windows system comprised four major steps as listed below.
- Download Kafka
- Install and Configure Kafka
- Starting Zookeeper and Kafka
Let us deep dive into each of them.
Download Kafka: You can download Apache Kafka from its official site using the Kafka.
Install and Configure Kafka
- Step 1: Once the Kafka package is downloaded, navigate to your Downloads folder. Select the binary file from the downloaded section.
- Step 2: Double-click or right-click on the zip file to extract the Kafka file. Where ever you wish to store the extracted files, move the extracted folder to that location.
- Step 3: Now, you have the extracted Kafka folder, you can easily copy its path. Search for the ‘config’ inside the extracted Kafka folder and quickly open the zookeeper.properties file.
- Step 4: The path to the Kafka folder that you copied in the previous step must be handy with you. Meanwhile, the path against the field data should be copied and instantly added to the /zookeeper-data path.
- Like if your path is C:/install_Kafka_windows/kafka then paste this path as
- dataDir = C:/install_Kafka_windows/kafka/zookeeper-data
- Step 5: Open the server.properties from the same folder and navigate to the log. dirs and paste the path there. You now need to add /Kafka-logs to it.
- Step 6: Now, your ZooKeepr and Kafka server configuration is completed.
Starting Zookeeper and Kafka
- Open the terminal and easily modify the directory to the Kafka folder. You can utilize the below command to first start Zookeeper.
- It's important to always turn on the ZooKeeper before Kafka.
- In addition, once work is done, only after Kafka is stopped ZooKeeper must be turned off.
- Open another terminal and change the directory to the Kafka folder. Here, you now need to start the Kafka server using the below-given command:
- Hurray! Your Kafka server is up and running. You are ready to start working with the steam data.
Conclusion
- As a mandatory pre-requisites do not forget to have Java JDK and 7-Zip already installed on your system.
- It's important to always turn the ZooKeepr before Lafka and once work is done, only after Kafka is stopped ZooKeepr must be turned off.
- Kafka is an open-source, distributed system that is utilized and implemented for real-time data streaming organizations to seamlessly work with their big data products.