diff --git a/hadoop/build.sh b/hadoop/build.sh index 46717a5..3cfbd91 100755 --- a/hadoop/build.sh +++ b/hadoop/build.sh @@ -7,6 +7,6 @@ docker stop hadoop docker rm hadoop docker run -dit --name hadoop --privileged=true \ - -v /data/hadoop/dfs:/dfs/data \ + --hostname hadoop01 \ -p 8042 -p 8088 -p 19888 -p 50070 -p 50075 zeekling/hadoop diff --git a/hadoop/hadoop/Dockerfile b/hadoop/hadoop/Dockerfile index 8528638..a0ab23a 100644 --- a/hadoop/hadoop/Dockerfile +++ b/hadoop/hadoop/Dockerfile @@ -33,7 +33,7 @@ RUN rm -rf /etc/yum.repos.d/*.repo COPY ./CentOS-8-reg.repo /etc/yum.repos.d/CentOS-Base.repo -RUN yum clean all && yum makecache && yum install -y openssh-server openssh-clients tar which +RUN yum clean all && yum makecache && yum install -y openssh-server openssh-clients tar which vim RUN set -eux && \ yum install -y wget hostname && \ @@ -94,6 +94,6 @@ ENV YARN_NODEMANAGER_USER=yarn #EXPOSE 8020 8042 8088 9000 10020 19888 50010 50020 50070 50075 50090 # Hadoop 3.0 changed ports :-( -EXPOSE 8020 8042 8088 9000 9868 9870 10020 19888 50010 50020 50090 +EXPOSE 9870 9871 19888 8088 9864-9869 8020 9000 9820 8032 CMD ["/entrypoint.sh"] diff --git a/hadoop/hadoop/conf/core-site.xml b/hadoop/hadoop/conf/core-site.xml index bb5a4cd..d69fcd5 100644 --- a/hadoop/hadoop/conf/core-site.xml +++ b/hadoop/hadoop/conf/core-site.xml @@ -3,6 +3,6 @@ fs.defaultFS - hdfs://localhost:8020 + hdfs://localhost:9820 diff --git a/hadoop/hadoop/conf/hdfs-site.xml b/hadoop/hadoop/conf/hdfs-site.xml index c8411de..ecdfcf6 100644 --- a/hadoop/hadoop/conf/hdfs-site.xml +++ b/hadoop/hadoop/conf/hdfs-site.xml @@ -1,16 +1,20 @@ - - dfs.replication - 1 - - - dfs.namenode.name.dir - /dfs/name - - - dfs.datanode.data.dir - /dfs/data - + + dfs.replication + 1 + + + dfs.permissions + false + + + dfs.namenode.name.dir + /dfs/name + + + dfs.datanode.data.dir + /dfs/data + diff --git a/hadoop/hadoop/entrypoint.sh b/hadoop/hadoop/entrypoint.sh index 773a873..c7bd7eb 100755 --- a/hadoop/hadoop/entrypoint.sh +++ b/hadoop/hadoop/entrypoint.sh @@ -99,6 +99,8 @@ EOF fi | tee -a /root/.ssh/known_hosts mkdir -pv /hadoop/logs + mkdir -p /dfs/data + chown -R hdfs:hadoop /dfs/ sed -i "s/localhost/$hostname/" /hadoop/etc/hadoop/core-site.xml if [ -f "/run/nologin" ];then @@ -107,6 +109,4 @@ EOF start-dfs.sh start-yarn.sh tail -f /dev/null /hadoop/logs/* - stop-yarn.sh - stop-dfs.sh fi