DrakopoulosAj
5 years ago
2 changed files with 25 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||||
|
FROM bde2020/hadoop-base:2.0.0-hadoop3.2.1-java8 |
||||
|
|
||||
|
MAINTAINER Ivan Ermilov <ivan.s.ermilov@gmail.com> |
||||
|
|
||||
|
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"] |
@ -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 |
Loading…
Reference in new issue