<commit_before>---
title: "Apache Kafka - Download and Install on Windows"
permalink: /apache-kafka-download-installation.html
excerpt: "A step-by-step tutorial on how to download, install and run Apache Kafka on Windows."
date: 2016-09-19
last_modified_at: 2016-09-19
header:
  teaser: "assets/images/teaser/apache-kafka-teaser.png"
categories: [Spring Kafka]
tags: [Apache Kafka, Apache ZooKeeper, Download, Installation, Kafka, Windows, ZooKeeper]
redirect_from:
  - /2016/09/apache-kafka-download-installation.html
published: true
---

<figure>
    <img src="{{ site.url }}/assets/images/logo/apache-kafka-logo.png" alt="apache kafka logo" class="logo">
</figure>

[Apache Kafka](http://kafka.apache.org/){:target="_blank"} is an open-source message broker project developed by the Apache Software Foundation written in Scala. The project aims to provide a high-throughput, low-latency platform capable of handling hundreds of megabytes of reads and writes per second from thousands of clients.

Following tutorial shows how to download and install Apache Kafka on Windows and perform a start/stop of the installed instance.

If you want to learn more about how to connect to Apache Kafka - head on over to the [Spring Kafka tutorials page]({{ site.url }}/spring-kafka/).
{: .notice--primary}

It is important to note that Kafka will not work without [Apache ZooKeeper](https://zookeeper.apache.org/){:target="_blank"}, which is essentially a distributed hierarchical key-value store. Like Kafka, ZooKeeper is a software project of the Apache Software Foundation. Kafka uses ZooKeeper for [electing a controller, cluster membership, topic configuration, quotas and ACLs](https://www.quora.com/What-is-the-actual-role-of-ZooKeeper-in-Kafka){:target="_blank"}.

Note that for running Kafka and ZooKeeper, a [Java Runtime Environment needs to be installed and configured](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (with JAVA_HOME correctly set){:target="_blank"}. If you are not sure if Java is installed on your machine, open a console and execute the following command:

``` plaintext
java -version
```

# Download and Setup ZooKeeper

<figure>
    <img src="{{ site.url }}/assets/images/logos/apache-zookeeper-logo.png" alt="apache zookeeper logo">
</figure>

Head over to the [Apache ZooKeeper download](https://zookeeper.apache.org/releases.html){:target="_blank"} page and and click on the download link in the <var>Download</var> section. This will redirect to a mirror site, click on the suggested mirror link and from the <var>index</var> select the <var>stable</var> directory as shown below. Download the gzipped TAR file.

At the moment of writing this tutorial, the latest stable release was [zookeeper-3.4.9](http://www-us.apache.org/dist/zookeeper/stable/){:target="_blank"}.

<figure>
    <img src="{{ site.url }}/assets/images/posts/spring-kafka/apache-zookeeper-stable-releases.png" alt="apache zookeeper stable releases">
</figure>

Extract the archive that was downloaded in the previous step. The extracted root directory should contain a number of files and subdirectories as shown below. From now on we will refer to this directory as: <var>[zookeeper_install_dir]</var>.

<figure><commit_msg>update image<commit_after>---
title: "Apache Kafka - Download and Install on Windows"
permalink: /apache-kafka-download-installation.html
excerpt: "A step-by-step tutorial on how to download, install and run Apache Kafka on Windows."
date: 2016-09-19
last_modified_at: 2016-09-19
header:
  teaser: "assets/images/teaser/apache-kafka-teaser.png"
categories: [Spring Kafka]
tags: [Apache Kafka, Apache ZooKeeper, Download, Installation, Kafka, Windows, ZooKeeper]
redirect_from:
  - /2016/09/apache-kafka-download-installation.html
published: true
---

<figure>
    <img src="{{ site.url }}/assets/images/logo/apache-kafka-logo.png" alt="apache kafka logo" class="logo">
</figure>

[Apache Kafka](http://kafka.apache.org/){:target="_blank"} is an open-source message broker project developed by the Apache Software Foundation written in Scala. The project aims to provide a high-throughput, low-latency platform capable of handling hundreds of megabytes of reads and writes per second from thousands of clients.

Following tutorial shows how to download and install Apache Kafka on Windows and perform a start/stop of the installed instance.

If you want to learn more about how to connect to Apache Kafka - head on over to the [Spring Kafka tutorials page]({{ site.url }}/spring-kafka/).
{: .notice--primary}

It is important to note that Kafka will not work without [Apache ZooKeeper](https://zookeeper.apache.org/){:target="_blank"}, which is essentially a distributed hierarchical key-value store. Like Kafka, ZooKeeper is a software project of the Apache Software Foundation. Kafka uses ZooKeeper for [electing a controller, cluster membership, topic configuration, quotas and ACLs](https://www.quora.com/What-is-the-actual-role-of-ZooKeeper-in-Kafka){:target="_blank"}.

Note that for running Kafka and ZooKeeper, a [Java Runtime Environment needs to be installed and configured](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (with JAVA_HOME correctly set){:target="_blank"}. If you are not sure if Java is installed on your machine, open a console and execute the following command:

``` plaintext
java -version
```

# Download and Setup ZooKeeper

<figure>
    <img src="{{ site.url }}/assets/images/logo/apache-zookeeper-logo.png" alt="apache zookeeper logo">
</figure>

Head over to the [Apache ZooKeeper download](https://zookeeper.apache.org/releases.html){:target="_blank"} page and and click on the download link in the <var>Download</var> section. This will redirect to a mirror site, click on the suggested mirror link and from the <var>index</var> select the <var>stable</var> directory as shown below. Download the gzipped TAR file.

At the moment of writing this tutorial, the latest stable release was [zookeeper-3.4.9](http://www-us.apache.org/dist/zookeeper/stable/){:target="_blank"}.

<figure>
    <img src="{{ site.url }}/assets/images/posts/spring-kafka/apache-zookeeper-stable-releases.png" alt="apache zookeeper stable releases">
</figure>

Extract the archive that was downloaded in the previous step. The extracted root directory should contain a number of files and subdirectories as shown below. From now on we will refer to this directory as: <var>[zookeeper_install_dir]</var>.

<figure>
{'fraction_non_alphanumeric': 0.10703269586674892, 'fraction_numerical': 0.0077112893275755705, 'mean_word_length': 4.960477941176471, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 6, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3140811', 'n_tokens_mistral': 1934, 'n_tokens_neox': 1827, 'n_words': 718}