# Hadoop Docker This repository provides setup for Hadoop cluster using Docker containers. Spin up NameNode, DataNode, ResourceManager, NodeManager, and HistoryServer—each in its own container. --- ## Versions - Hadoop: 3.4.1 - Java: 17 --- > [!IMPORTANT] > You may have to restart the `hadoop-resourcemanager` few times before it actually starts running. ## Quick Start To deploy an example HDFS cluster, run: ```shell docker-compose up -d ``` Run example wordcount job: ```shell make wordcount ``` Or deploy in swarm: ```shell docker stack deploy -c docker-compose-v3.yml hadoop ``` `docker-compose` creates a docker network that can be found by running `docker network list`, e.g. `dockerhadoop_default`. Run `docker network inspect` on the network (e.g. `dockerhadoop_default`) to find the IP the hadoop interfaces are published on. Access these interfaces with the following URLs: - Namenode: http://:9870/dfshealth.html#tab-overview - History server: http://:8188/applicationhistory - Datanode: http://:9864/ - Nodemanager: http://:8042/node - Resource manager: http://:8088/ ## Configure Environment Variables The configuration parameters can be specified in the hadoop.env file or as environmental variables for specific services (e.g. namenode, datanode etc.): ``` CORE_CONF_fs_defaultFS=hdfs://namenode:8020 ``` CORE_CONF corresponds to core-site.xml. fs_defaultFS=hdfs://namenode:8020 will be transformed into: ``` fs.defaultFShdfs://namenode:8020 ``` To define dash inside a configuration parameter, use triple underscore, such as YARN_CONF_yarn_log___aggregation___enable=true (yarn-site.xml): ``` yarn.log-aggregation-enabletrue ``` The available configurations are: - /etc/hadoop/core-site.xml CORE_CONF - /etc/hadoop/hdfs-site.xml HDFS_CONF - /etc/hadoop/yarn-site.xml YARN_CONF - /etc/hadoop/httpfs-site.xml HTTPFS_CONF - /etc/hadoop/kms-site.xml KMS_CONF - /etc/hadoop/mapred-site.xml MAPRED_CONF If you need to extend some other configuration file, refer to base/entrypoint.sh bash script. --- > [!NOTE] > This repo is a fork of [big-data-europe/docker-hadoop](https://github.com/big-data-europe/docker-hadoop/)