Unzip the hadoop-singlenode.zip
file to your desired directory.
Open your terminal or command prompt and cd
to the directory where you unzipped the file:
cd path_to_unzipped_folder
Run the following command to build the Docker image:
docker build -t hadoop-singlenode .
Use this command to create and start the Docker container:
docker run -it --name hadoop-singlenode -p 9870:9870 -p 8088:8088 -v namenode-data:/hadoop/dfs/namenode -v datanode-data:/hadoop/dfs/datanode -v secondarynamenode-data:/hadoop/dfs/secondarynamenode --network dasnet hadoop-singlenode
Once inside the container, start the Hadoop services:
sudo service ssh start
$HADOOP_HOME/sbin/start-dfs.sh
$HADOOP_HOME/sbin/start-yarn.sh
Open your browser and go to:
Run the following commands to perform quick tests:
hdfs dfsadmin -report
hdfs dfs -mkdir /test
hdfs dfs -ls /
yarn node -list
Note: Ensure the hadoop-3.4.0.tar.gz
file is in the directory or it will be downloaded automatically during the build process. If the download fails, manually download it from this link and place it in the directory.
Once everything is up and running, your single-node Hadoop setup is ready for use!