Run Hadoop Cluster within Docker Containers
322
sudo docker pull lyingbo/hadoop:3.2.0
git clone https://github.com/lyingbo/hadoop-cluster-docker.git
cd hadoop-cluster-docker
sudo ./start-container.sh
output:
start hadoop-master container...
start hadoop-slave1 container...
start hadoop-slave2 container...
root@hadoop-master:/#
start-all.sh
output
Starting namenodes on [hadoop-master]
hadoop-master: Warning: Permanently added 'hadoop-master,172.18.0.2' (ECDSA) to the list of known hosts.
Starting datanodes
hadoop-slave2: Warning: Permanently added 'hadoop-slave2,172.18.0.4' (ECDSA) to the list of known hosts.
hadoop-slave1: Warning: Permanently added 'hadoop-slave1,172.18.0.3' (ECDSA) to the list of known hosts.
Starting secondary namenodes [hadoop-master]
Starting resourcemanager
Starting nodemanagers
run-wordcount.sh
output
input file1.txt:
Hello Docker
input file2.txt:
Hello Hadoop
input file3.txt:
Hello MapReduce
wordcount output:
Docker 1
Hadoop 1
Hello 3
MapReduce 1
do 2 like section A
sudo ./resize-cluster.sh 5
sudo ./start-container.sh 5
do 4~5 like section A
Content type
Image
Digest
Size
528.1 MB
Last updated
over 6 years ago
docker pull lyingbo/hadoop:3.2.0