增加hadoop 2.8.4构建

This commit is contained in:
yangyu 2018-08-01 23:18:33 +08:00
parent 68649b13b8
commit 36980215d6
8 changed files with 167 additions and 0 deletions

55
hadoop/2.8.4/Dockerfile Normal file
View File

@ -0,0 +1,55 @@
FROM ccr.ccs.tencentyun.com/yy-dk/centos-sshd:7.0
MAINTAINER Yang <yangyufans@qq.com>
ENV HADOOP_VERSION 2.8.4
RUN yum install -y wget which
RUN cd / && wget http://yy-bak.oss-cn-qingdao.aliyuncs.com/jdk/jdk-8u172-linux-x64.tar.gz \
&& tar -zvxf jdk-8u172-linux-x64.tar.gz -C /usr/local \
&& rm -rf jdk-8u172-linux-x64.tar.gz
ENV JDK_VERSION "jdk1.8.0_172"
ENV JAVA_HOME "/usr/local/$JDK_VERSION"
RUN cd / && wget http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz \
&& tar -zxvf hadoop-$HADOOP_VERSION.tar.gz -C /usr/local \
&& rm -rf hadoop-$HADOOP_VERSION.tar.gz
ENV HADOOP_HOME "/usr/local/hadoop-$HADOOP_VERSION"
ENV PATH "$PATH:$JAVA_HOME/bin"
ENV PATH "$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin"
RUN echo "export JAVA_HOME=/usr/local/$JDK_VERSION" >> /etc/profile && \
echo "export HADOOP_HOME=$HADOOP_HOME" >> /etc/profile && \
echo 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile && \
echo 'export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin' >> /etc/profile && \
source /etc/profile
RUN mkdir /conf /logs /data
RUN echo "ZONE=Asia/Shanghai" > /etc/sysconfig/clock && \
rm -rf /etc/localtime && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa && \
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
ENV YARN_LOG_DIR "/logs"
RUN sed -i 's/export JAVA_HOME=${JAVA_HOME}/export JAVA_HOME=\/usr\/local\/jdk1.8.0_172/g' $HADOOP_HOME/etc/hadoop/hadoop-env.sh && \
echo "export HADOOP_LOG_DIR=/logs" >> $HADOOP_HOME/etc/hadoop/hadoop-env.sh && \
echo "export HADOOP_PREFIX=$HADOOP_HOME" >> $HADOOP_HOME/etc/hadoop/hadoop-env.sh && \
sed -e "1 i\export YARN_LOG_DIR=\/logs" $HADOOP_HOME/etc/hadoop/yarn-env.sh > $HADOOP_HOME/etc/hadoop/yarn-env.sh.bak && \
\mv $HADOOP_HOME/etc/hadoop/yarn-env.sh.bak $HADOOP_HOME/etc/hadoop/yarn-env.sh
COPY conf/* $HADOOP_HOME/etc/hadoop/
COPY start.sh /
RUN chmod 777 /start.sh
EXPOSE 22 50070 8020 8088 8042 8030 8031 8032 8033
CMD ["/start.sh"]

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:8020</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/data</value>
</property>
</configuration>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>localhost:50090</value>
</property>
<property>
<name>dfs.namenode.secondary.https-address</name>
<value>localhost:50091</value>
</property>
</configuration>

View File

@ -0,0 +1,24 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>

View File

@ -0,0 +1 @@
localhost

1
hadoop/2.8.4/conf/slaves Normal file
View File

@ -0,0 +1 @@
localhost

View File

@ -0,0 +1,20 @@
<?xml version="1.0"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>

8
hadoop/2.8.4/start.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
\cp /conf/hadoop/* $HADOOP_HOME/etc/hadoop
echo "127.0.0.1 localhost" > /etc/hosts
/usr/sbin/sshd -D