From 89bbf55f19058b3fd5ad65f9ddf8ad024ef72082 Mon Sep 17 00:00:00 2001 From: DrakopoulosAj Date: Fri, 12 Jun 2020 18:49:11 +0000 Subject: [PATCH] Upload files to '' --- Dockerfile | 16 ++++++++++++++++ run.sh | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile create mode 100644 run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..55be14a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM bde2020/hadoop-base:2.0.0-hadoop3.2.1-java8 + +MAINTAINER Ivan Ermilov + +HEALTHCHECK CMD curl -f http://localhost:9864/ || exit 1 + +ENV HDFS_CONF_dfs_datanode_data_dir=file:///hadoop/dfs/data +RUN mkdir -p /hadoop/dfs/data +VOLUME /hadoop/dfs/data + +ADD run.sh /run.sh +RUN chmod a+x /run.sh + +EXPOSE 9864 + +CMD ["/run.sh"] diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..bbbb9e3 --- /dev/null +++ b/run.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +datadir=`echo $HDFS_CONF_dfs_datanode_data_dir | perl -pe 's#file://##'` +if [ ! -d $datadir ]; then + echo "Datanode data directory not found: $datadir" + exit 2 +fi + +$HADOOP_HOME/bin/hdfs --config $HADOOP_CONF_DIR datanode