This Docker image provides a local MiniDFSCluster environment to simplify testing HDFS-based applications such as Apache Spark.
/tmp and /user directories in HDFS.docker pull avs75alatau/minidfscluster:latest
docker run -d --name hdfs-minicluster --network=host -e NUM_DATANODES=3 avs75alatau/minidfscluster:latest
docker run -d --name hdfs-minicluster -p 35200:35200 -p 35100:35100 -p 30000-30030:30000-30030 -e NUM_DATANODES=3 avs75alatau/minidfscluster:latest
NUM_DATANODES environment variable is optional. If omitted, the cluster will start with one DataNode by default.NUM_DATANODES is 9.352003510030000-30030Wait for about 30 seconds after starting the container, then check the logs:
docker logs hdfs-minicluster
This will display connection information, including the configured ports.
Use the full HDFS path to interact with the file system. For example:
hdfs dfs -ls hdfs://localhost:35200/
The container automatically creates the following directories in HDFS:
/tmp/userTo use this image with spark-shell for testing:
/opt/spark-3.5.1/bin/spark-shell --master local[*] \
--conf spark.hadoop.fs.defaultFS=hdfs://localhost:35200
For issues, improvements, or contributions, please contact GitHub.
Happy Testing!
Content type
Image
Digest
sha256:f709a9971…
Size
1 GB
Last updated
over 1 year ago
docker pull avs75alatau/minidfscluster