Apache Kafka Docker Image Installation and Usage Tutorial on Windows

Introduction

My previous tutorial was on Apache Kafka Installation on Linux. I used Linux operating system (on VirtualBox) hosted in my Windows 10 HOME machine. Sometimes, it may seem a little complicated because of the VirtualBox setup and related activities. Hence, I thought of writing this tutorial to run Kafka purely on windows. For this purpose, I had to upgrade my Windows 10 HOME operating system to Windows 10 Pro.

Tech Stack

Here is the tech stack for this tutorial.

Installation and verification

You can download the Docker for Windows from the docker official download page. Ensure to download from the stable channel only. Once downloaded, installation is pretty straightforward; follow the simple instructions. Next, click on the Docker for Windows icon on the desktop to start the docker. When you click this icon, you may see a pop-up like the following asking to enable the Hyper-V feature. Click on OK Button.

windows-10-docker-hyper-v-enable-warning

windows-10-docker-hyper-v-enable-warning

You may have to wait a while, as the system will restart automatically. Keep patience; once the machine starts, docker will be running. You can check the docker running status from the taskbar, bottom right corner.

Now, open a command prompt and run the command docker –version like below; you will see the version of the docker running.

We will run the hello-world image to ensure the docker is installed correctly and set. Execute the following command –

When it runs, you will see some texts like the one below. The highlighted lines (8-9) show that the docker installation appears proper.

Kafka Image Installation on Windows

We will use a docker image to install Kafka. The image we’ll use here is developed by Landoop. The image and the usage instruction is available on GitHub; refer to https://github.com/Landoop/fast-data-dev.

Please run the following command; it will fetch the Landoop’s Kafka image and run the same. While the command is running, if you notice Windows/any other firewall blocking some apps; grant access  –

In the command window, you will notice logs like the below –

The first few lines in the log warning about insufficient memory and possible performance issues. We can continue using this setup. However, if you have enough RAM available in your system, you can also use the steps mentioned on landoop github page to create a better-performing setup (by assigning more RAM).

You can also access landoop’s excellent web portal by hitting http://127.0.0.1:3030. This portal will provide a comprehensive visual representation of your Kafka setup. You will see a UI depicting the current setup of Kafka. You’ll be able to see several schemas, topics, etc. Towards the end of the page, you will also see various service ports. You will see a running circle under the COYOTE HEALTH CHECKS. This is verifying the settings. It may take some time to complete depending on your system’s configuration. Below is a snapshot of the UI on my laptop while writing the post –

kafka-landoop-ui-components

kafka-landoop-ui-components

132

2 Responses

  1. Rohit
    October 15, 2018
  2. Sadruddin Md
    October 15, 2018

Write a response

This site uses Akismet to reduce spam. Learn how your comment data is processed.