Comprehensive Guide on How to Install Apache Druid on Windows Using WSL (Windows Subsystem for Linux) 2024

Introduction

Apache Druid is a real-time analytics database designed for high-speed data ingestion and query execution. It is widely used in big data analytics, business intelligence, and real-time event processing.

πŸš€ Why Use Apache Druid?
βœ” Fast Query Performance – Handles billions of events per second.
βœ” Real-Time Streaming Ingestion – Processes Kafka and Kinesis streams efficiently.
βœ” Scalability – Supports large-scale cloud deployments.
βœ” Multi-Tenant Support – Optimized for multi-user queries.

This guide will walk you through installing Apache Druid on Windows using Windows Subsystem for Linux (WSL).


1. Prerequisites

Before installing Apache Druid, ensure you have: βœ” Windows 11 (or Windows 10 with WSL2 support)
βœ” Ubuntu 22.04 LTS installed via WSL
βœ” Java 17 JRE (OpenJDK 17 required for Druid)
βœ” Administrator access to enable WSL features


2. Install Windows Subsystem for Linux (WSL)

βœ… Step 1: Enable WSL in Windows

1️⃣ Open Microsoft Store on your Windows machine.
2️⃣ Search for Windows Subsystem for Linux.
3️⃣ Download and install WSL.

Alternatively, you can enable WSL via PowerShell:

powershellCopyEditwsl --install

πŸ’‘ This command installs WSL and sets up Ubuntu as the default distribution.


3. Install Ubuntu on WSL

βœ… Step 2: Install Ubuntu 22.04 LTS

1️⃣ Open Microsoft Store.
2️⃣ Search for Ubuntu 22.04 LTS.
3️⃣ Click Install and wait for the setup to complete.

βœ… Step 3: Enable Windows Features

1️⃣ Search for Turn Windows features on or off in the Windows Start Menu.
2️⃣ Enable the following: βœ” Virtual Machine Platform
βœ” Windows Subsystem for Linux
3️⃣ Click OK and restart your system.


4. Set Up Apache Druid in Ubuntu (WSL)

βœ… Step 4: Open Ubuntu and Create a User Account

After installing Ubuntu: 1️⃣ Launch Ubuntu from the Start Menu.
2️⃣ Set up a username and password for your WSL environment.

βœ… Step 5: Install Java 17 (OpenJDK)

Apache Druid requires Java 17 JRE. Install it using:

bashCopyEditsudo apt update
sudo apt install openjdk-17-jre-headless -y

πŸ’‘ Verify installation using:

bashCopyEditjava -version

βœ” If installed correctly, it should display:

plaintextCopyEditopenjdk version "17.x.x" 

5. Download and Install Apache Druid

βœ… Step 6: Download Apache Druid

Download the latest Apache Druid binary package from Apache:

bashCopyEditwget https://dlcdn.apache.org/druid/28.0.1/apache-druid-28.0.1-bin.tar.gz

βœ… Step 7: Extract the Druid Archive

Unzip the downloaded package:

bashCopyEdittar -xzf apache-druid-28.0.1-bin.tar.gz

Move to the Druid installation directory:

bashCopyEditcd apache-druid-28.0.1

6. Start Apache Druid

βœ… Step 8: Start the Druid Services

To start Apache Druid, run:

bashCopyEdit./bin/start-druid

πŸ’‘ Druid starts multiple services, including: βœ” Coordinator – Manages data and segment distribution.
βœ” Overlord – Handles ingestion tasks.
βœ” Broker – Routes queries to data nodes.
βœ” Historical – Stores and serves past data.
βœ” MiddleManager – Handles real-time ingestion.


7. Access Apache Druid UI

βœ… Step 9: Open Druid Web Console

Once Druid is running, access the web UI:

  • Method 1: Open the browser and go to:arduinoCopyEdithttp://localhost:8888/
  • Method 2: Use the Ctrl + Click option on the given terminal link.

8. Restarting Apache Druid

βœ… Step 10: Restart Druid (If Needed)

If the Druid process stops or exits, restart it:

bashCopyEdit./bin/start-druid

πŸ’‘ Best Practice: Set up a background process to ensure Druid runs persistently.


9. Troubleshooting Installation Issues

IssuePossible Fix
Java Not FoundReinstall Java 17: sudo apt install openjdk-17-jre-headless
WSL Not RecognizedEnable WSL using: wsl --install
Druid UI Not LoadingCheck logs: tail -f var/sv/broker.log

10. Conclusion

Apache Druid is a powerful real-time analytics database, and installing it on Windows via WSL makes it easier to use. By following this guide, you can set up, run, and manage Druid for real-time data processing.

βœ… Key Takeaways

βœ” Install WSL and Ubuntu 22.04 to run Druid on Windows.
βœ” Use Java 17 (OpenJDK) for compatibility.
βœ” Start Druid using ./bin/start-druid and access it via http://localhost:8888/.
βœ” Automate startup for persistent deployments.

πŸ’‘ Are you using Apache Druid for analytics? Share your experience in the comments! πŸš€


Would you like a step-by-step video tutorial on setting up Druid?

Leave a Comment

Your email address will not be published. Required fields are marked *