This commit is contained in:
LingZhaoHui 2022-09-28 22:47:19 +08:00
parent 70e59d6540
commit 7bc58000b4
5 changed files with 22 additions and 18 deletions

View File

@ -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

View File

@ -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"]

View File

@ -3,6 +3,6 @@
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:8020</value>
<value>hdfs://localhost:9820</value>
</property>
</configuration>

View File

@ -1,16 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/dfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/dfs/data</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/dfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/dfs/data</value>
</property>
</configuration>

View File

@ -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