bash <(curl -fsSL https://raw.githubusercontent.com/darshan-gowdaa/wsl-hadoop-installer/main/installv4.sh)Simple one-command setup to run the Hadoop ecosystem on WSL2 and Native Linux.
Made for students so you don't waste time fixing Java, SSH, or HDFS issues. Now platform-aware!
- Windows 10/11 (with WSL2) OR Native Linux (Ubuntu/Debian)
- Minimum 16 GB RAM recommended (8 GB also works with limits)
- ~15 GB free disk space
- Internet connection
If you are on Native Linux, skip to the Installation section.
Open PowerShell as Administrator and run:
wsl --updateWait for the update to complete.
Then, install Ubuntu using one of the following options:
Option A: Command Line
wsl --install ubuntuOption B: Microsoft Store
Download Ubuntu from Microsoft Store
After installation completes, close PowerShell.
- Open Start Menu → search Turn Windows features on or off
- Enable the following options:
- Windows Subsystem for Linux
- Virtual Machine Platform
- Click OK and restart when prompted
You can configure WSL memory either through WSL Settings in Windows (easier) or by creating a config file (more control).
-
Open WSL Settings
- Press the Windows key (or click Start)
- Type:
WSL Settings - Click on "WSL Settings" or "Windows Subsystem for Linux Settings"
-
Navigate to Memory and Processor
- In the left sidebar, click "Memory and processor"
-
Configure Based on Your System RAM
If your system has 8 GB RAM:
- Processor Count: Set to 2
- Memory Size: Set to 6144 MB (6 GB)
- Swap Size: Set to 2048 MB (2 GB)
If your system has 16 GB RAM or more:
- Processor Count: Set to 4
- Memory Size: Set to 8192 MB (8 GB)
- Swap Size: Set to 2048 MB (2 GB)
-
Apply Changes
- The settings save automatically
- Open PowerShell and run:
wsl --shutdown- Wait 10 seconds, then reopen Ubuntu
Step 1: Create this file in Windows:
C:\Users\<YOUR_WINDOWS_USERNAME>\.wslconfig
Step 2: Open with Notepad and paste:
For 8 GB RAM:
[wsl2]
memory=6GB
processors=2
swap=2GBFor 16 GB+ RAM:
[wsl2]
memory=8GB
processors=4
swap=2GBStep 3: Save and apply:
wsl --shutdown
Why This Matters:
- Without proper limits, WSL can consume all your RAM and freeze Windows
- Hadoop/Spark need sufficient memory but shouldn't starve your host OS
After reboot:
- Open Ubuntu from Start Menu or run
wslin PowerShell. Create your Linux username and password when prompted.
Run the installer inside your terminal (WSL or Native Linux):
bash <(curl -fsSL https://raw.githubusercontent.com/darshan-gowdaa/wsl-hadoop-installer/main/installv4.sh)During installation, allow Java and SSH in Windows Firewall if prompted (WSL only).
The installer supports installing the following Big Data programs:
- Hadoop (3.4.2): Core HDFS, YARN, and MapReduce framework.
- Spark (3.5.8): In-memory fast analytics engine (configured for YARN).
- Kafka (4.1.1): Stream processing with KRaft mode (no ZooKeeper needed).
- Pig (0.17.0): Data flow scripting language for Hadoop.
- Hive (3.1.3): Data warehouse software facilitating reading, writing, and managing large datasets residing in distributed storage using SQL.
- Eclipse IDE: Configured out-of-the-box for writing Hadoop MapReduce programs.
The installer detects your platform and provides an interactive menu:
Components
- 1-6) Select individual components to install.
- A) Install ALL Components (Hadoop + Spark + Kafka + Hive + Pig)
Management & Tools
- 7) Start All Services
- 8) Stop All Services
- 9) Check System Status
- P) Create Eclipse Project (Automates MapReduce boilerplate setup)
System Options
- U) Update System (Update APT/Snap packages)
- D) Uninstall Components (Interactive removal menu)
- S) Create Script Shortcut (
dg-script.sh) - 0) Exit
Core & Hidden Features
The v4 installer includes several advanced automations running in the background to prevent common bugs:
Modern Hadoop requires Java 11, Kafka requires Java 17, and Hive works best on Java 8. The script automatically installs all three and injects smart wrappers into your .bashrc.
When you type a Kafka command, it transparently uses Java 17, while Hadoop defaults to Java 11, avoiding ClassVersion errors automatically.
Hadoop is infamous for hanging if it runs out of memory. The installer inspects your machine's total RAM and dynamically configures yarn-site.xml and mapred-site.xml limits so that containers have enough memory to run MapReduce jobs without crashing your system.
Instead of starting HDFS, YARN, Hive, and Kafka manually, the script creates two global shortcuts in your home directory (~/start-hadoop.sh and ~/stop-hadoop.sh).
- It starts MySQL automatically for Hive.
- It sequentially waits for NameNodes to exit "Safe Mode" before starting Hive's Metastore.
- It triggers Kafka in KRaft mode asynchronously.
- IPv6 Auto-Disable: Prevents strange "connection refused" errors in Hadoop.
- Intelligent DNS: If WSL fails to resolve network addresses (common issue), the script automatically injects Cloudflare/Google DNS servers.
- Mirror Fallbacks: If an Apache download mirror is down, the script instantly falls back to an archive mirror so installations don't fail midway.
A fresh Hadoop cluster cannot be used until proper user folders are created. The installer automatically drops into HDFS, runs mkdir -p /user/$USER, /spark-logs, and /user/hive/warehouse, and chmod 777s them so Spark and Hive don't throw permission errors on launch.
You don't need to curl the script every time! Press S in the installer menu to create a global shortcut. You can then launch the installer from anywhere by just typing:
dg-script.shPressing P from the menu opens the Eclipse Project generation wizard. It automatically:
- Creates a new Eclipse workspace project with your given name.
- Pre-configures the Java 1.8 compiler (required by Hadoop).
- Adds all the required Hadoop JARs (Common, HDFS, YARN, MapReduce) into the
.classpath. - Scaffolds your Main Class and Launch Configuration.
- Opens Eclipse directly into your newly generated file.
Pressing D from the menu opens the Uninstall options. You can choose to safely and cleanly remove individual components (like just Spark, or just Hive) or use option A to wipe all installed components and configurations instantly.
After installation completes:
# Reload environment
source ~/.bashrc
# Start all services
~/start-hadoop.sh
# Verify HDFS is working
hdfs dfs -ls /
# Run a MapReduce example
hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar pi 2 5
# Start Spark shell
spark-shell
# Create a Kafka topic
kafka-topics --create --topic test --bootstrap-server localhost:9092
# Start Hive
hive
# Launch Eclipse for development
eclipse-hadoopAfter starting services with ~/start-hadoop.sh:
- HDFS NameNode: http://localhost:9870
- YARN ResourceManager: http://localhost:8088
- DataNode: http://localhost:9864
- NodeManager: http://localhost:8042
- Copy:
Ctrl + Shift + C - Paste:
Ctrl + Shift + V
"Cannot run from Windows filesystem"
- Solution: Run from Linux home:
cd ~ && bash <(curl -fsSL ...)
"Insufficient disk space"
- Solution: Free up at least 15 GB in your WSL/Linux distribution
"SSH connection failed"
- Solution: Verify SSH service:
sudo service ssh status
Services won't start
- Check if another Hadoop instance is running
- Verify ports are free:
netstat -tuln | grep 9870
HDFS stuck in safe mode
hdfs dfsadmin -safemode leaveHive connection errors
sudo service mysql status
sudo service mysql restartKafka fails to start
# Check Java 17 is installed
java -versionCheck logs:
cat ~/hadoop_install.logQ: Can I run this on Windows 10?
A: Yes, but you need WSL2. Run wsl --update in PowerShell.
Q: Can I run this on Native Linux?
A: Yes, v4 supports native Linux (Ubuntu/Debian) natively.
Q: Do I need Docker?
A: No, everything runs natively in WSL2 or Linux.
Q: Can I access HDFS from Windows?
A: Yes, using \\wsl$\Ubuntu\home\<username>\bigdata\ in File Explorer for local files, or use HDFS commands from WSL terminal.
Q: Is this production-ready?
A: This is for learning and development only.
- WSL2 Ubuntu 22.04 / 24.04
- Native Ubuntu 22.04 / 24.04
- Windows 11
Installer by github.com/darshan-gowdaa
Star the repo if you find it useful!
MIT License - Feel free to use and modify
Happy Learning!
