-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
69 lines (58 loc) · 3.4 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
FROM centos:7
MAINTAINER Steffen Roegner "[email protected]"
USER root
ENV JAVA_HOME=/usr
ENV HADOOP_HOME=/usr/hdp/current/hadoop-client
ENV HADOOP_HDFS_HOME=/usr/hdp/current/hadoop-hdfs-client
ENV HADOOP_MAPRED_HOME=/usr/hdp/current/hadoop-mapreduce-client
ENV HADOOP_YARN_HOME=/usr/hdp/current/hadoop-yarn-client
ENV HADOOP_LIBEXEC_DIR=/usr/hdp/current/hadoop-client/libexec
ENV CONSUL_VERSION=0.5.2
ENV CONSUL_TEMPLATE_VERSION=0.9.0
ENV ACCUMULO_VERSION=1.7.0
ENV REFRESHED_AT 2015-06-08
RUN rpm -ivh http://epel.mirror.constant.com/7/x86_64/e/epel-release-7-5.noarch.rpm; \
yum -y -q upgrade; \
yum -y install tar snappy lzo which bind-utils java-1.7.0-openjdk-devel unzip supervisor gcc-c++ openssh-clients openssh-server pssh; \
curl -L http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.4.2/hdp.repo -o /etc/yum.repos.d/hdp.repo; \
curl -L http://apache.osuosl.org/accumulo/${ACCUMULO_VERSION}/accumulo-${ACCUMULO_VERSION}-bin.tar.gz | tar xz --no-same-owner -C /usr/lib; \
yum -y install hadoop hadoop-hdfs hadoop-libhdfs hadoop-yarn hadoop-mapreduce hadoop-client zookeeper; \
yum clean all
RUN mkdir -p /data1/hdfs /data1/mapred /data1/yarn /var/log/hadoop /var/log/hadoop-yarn /var/log/supervisor /var/log/consul /var/lib/consul/data /var/lib/consul/ui /etc/consul /etc/consul-leader /var/lib/zookeeper; \
chown hdfs.hadoop /data1/hdfs && \
chown mapred.hadoop /data1/mapred && \
chown yarn.hadoop /data1/yarn; \
chown zookeeper.hadoop /var/lib/zookeeper; \
chmod 775 /var/log/hadoop; chgrp hadoop /var/log/hadoop; \
cd /usr/sbin; \
curl -L https://github.com/hashicorp/consul-template/releases/download/v${CONSUL_TEMPLATE_VERSION}/consul-template_${CONSUL_TEMPLATE_VERSION}_linux_amd64.tar.gz | tar xz --no-same-owner --strip-components=1 && \
curl -L https://dl.bintray.com/mitchellh/consul/${CONSUL_VERSION}_linux_amd64.zip -o /tmp/c.zip && \
curl -L https://dl.bintray.com/mitchellh/consul/${CONSUL_VERSION}_web_ui.zip -o /tmp/ui.zip && \
unzip /tmp/c.zip -d /usr/sbin && \
unzip /tmp/ui.zip -d /var/lib/consul/ui
COPY config/accumulo /var/lib/accumulo/conf/
RUN ln -s /usr/lib/accumulo-${ACCUMULO_VERSION} /usr/lib/accumulo; \
useradd -u 6040 -G hadoop -d /var/lib/accumulo accumulo; \
mkdir -p /etc/accumulo /var/lib/accumulo/conf /var/log/accumulo; \
chown -R accumulo.accumulo /var/lib/accumulo /var/log/accumulo; \
mv /usr/lib/accumulo/conf /usr/lib/accumulo/conf.dist; \
rm -rf /usr/lib/accumulo/logs; \
ln -s /var/lib/accumulo/conf /usr/lib/accumulo/conf; \
ln -s /var/lib/accumulo/conf /etc/accumulo/conf; \
ln -s /var/log/accumulo /usr/lib/accumulo/logs; \
JAVA_HOME=/usr/lib/jvm/java /usr/lib/accumulo/bin/build_native_library.sh
COPY config/ssh /etc/ssh/
RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
COPY config/supervisord.conf /etc/
COPY config/hadoop /etc/hadoop/conf
COPY config/zookeeper /etc/zookeeper/conf/
COPY config/supervisor /etc/supervisor/conf.d/
COPY config/consul /etc/consul/
COPY config/consul/consul.json /etc/consul-leader/
COPY scripts /usr/local/sbin/
USER accumulo
RUN ssh-keygen -t rsa -b 2048 -f /var/lib/accumulo/.ssh/id_rsa -N "" && cp /var/lib/accumulo/.ssh/id_rsa.pub /var/lib/accumulo/.ssh/authorized_keys && chmod 600 /var/lib/accumulo/.ssh/authorized_keys
USER hdfs
RUN HADOOP_ROOT_LOGGER="WARN,console" /usr/bin/hdfs namenode -format
USER root
VOLUME /etc/hadoop/conf