From 460e647d391551bae447c7b4453e3577d31b04a6 Mon Sep 17 00:00:00 2001 From: Antoine Gicquel Date: Mon, 5 Feb 2018 15:20:40 +0100 Subject: [PATCH 1/3] fix the class com.sun.tools.javac.Main not found problem --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 5332b3d3..d07f1b55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,7 @@ RUN wget https://github.com/kiwenlau/compile-hadoop/releases/download/2.7.2/hado # set environment variable ENV JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 ENV HADOOP_HOME=/usr/local/hadoop +ENV HADOOP_CLASSPATH=/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar ENV PATH=$PATH:/usr/local/hadoop/bin:/usr/local/hadoop/sbin # ssh without key From a1e0f1cc906a62799689e9c13588387f5294cf52 Mon Sep 17 00:00:00 2001 From: Antoine Gicquel Date: Mon, 5 Feb 2018 15:21:21 +0100 Subject: [PATCH 2/3] add a preserved start mode that doesn't remove previous data --- start-container-preserved.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 start-container-preserved.sh diff --git a/start-container-preserved.sh b/start-container-preserved.sh new file mode 100755 index 00000000..4231aa39 --- /dev/null +++ b/start-container-preserved.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# the default node number is 3 +N=${1:-3} + + +# start hadoop master container +echo "start hadoop-master container..." +sudo docker run -itd \ + --net=hadoop \ + -p 50070:50070 \ + -p 8088:8088 \ + --name hadoop-master \ + --hostname hadoop-master \ + kiwenlau/hadoop:1.0 &> /dev/null + + +# start hadoop slave container +i=1 +while [ $i -lt $N ] +do + echo "start hadoop-slave$i container..." + sudo docker run -itd \ + --net=hadoop \ + --name hadoop-slave$i \ + --hostname hadoop-slave$i \ + kiwenlau/hadoop:1.0 &> /dev/null + i=$(( $i + 1 )) +done + +# get into hadoop master container +sudo docker exec -it hadoop-master bash From ee9c91b85625dec48bee901e0818de39b3a890b5 Mon Sep 17 00:00:00 2001 From: Antoine Gicquel Date: Mon, 5 Feb 2018 15:25:18 +0100 Subject: [PATCH 3/3] add preserved mode doc --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 1ea382b1..00159f0a 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,13 @@ cd hadoop-cluster-docker sudo ./start-container.sh ``` + +If you want to keep the data from your previous launch + +``` +sudo ./start-container-preserved.sh +``` + **output:** ```