This repo provides an easy way to set up a Hadoop environment using Docker, designed for Big Data course labs. It avoids complicated local installations and lets you get started with minimal setup.
By default, the Dockerfile downloads Hadoop from the internet.
If you already have the hadoop-3.4.1.tar.gz file locally, follow these steps:
- Place
hadoop-3.4.1.tar.gzin the project directory. - In the
Dockerfile:- Uncomment:
COPY hadoop-3.4.1.tar.gz /tmp/hadoop.tar.gz - Comment out the line that uses
wget.
- Uncomment:
docker build -t big-data-section .docker run -it --name section-container -p 9870:9870 -p 8088:8088 -p 9000:9000 big-data-sectionThis exposes the necessary ports for the Hadoop Web UI and services.
Assuming you have the material in a local folder:
docker cp /full/path/to/sections_data section-container:/home/hadoop/docker exec -it section-container bashdocker stop section-containerdocker start -ai section-containerdocker save -o big-data-section.tar big-data-sectionShare the big-data-section.tar file via USB, Google Drive, etc.
docker load -i big-data-section.tarThen run it normally:
docker run -it --name section-container -p 9870:9870 -p 8088:8088 -p 9000:9000 big-data-section- The first build may take some time.
- Make sure Docker is installed and running before starting.
- If you're using WSL on Windows, use Linux-style paths and check port availability.
- Your image name is:
big-data-section - Your container name is:
section-container - Your hostname inside container is:
hadoop-node
-
Visit NameNode Web UI →
http://localhost:9870 -
Visit YARN ResourceManager UI →
http://localhost:8088 -
SSH into the container if needed on port 22
-
You can run Python-based MapReduce with
mrjob:python mrjob_script.py input_file
Docker can consume a significant amount of system memory. To limit its usage, copy the
.wslconfigfile to your user directory (e.g.,C:\Users\YourUsername\).
Made for Big Data course labs – by students, for students 👨🎓👩🎓
By Abdulahmed Samy