├── 2.3.0
├── Dockerfile
├── core-site.xml
├── hdfs-site.xml
├── mapred-site.xml
└── yarn-site.xml
├── 2.6.0
├── Dockerfile
├── conf
│ ├── core-site.xml
│ ├── hdfs-site.xml
│ ├── mapred-site.xml
│ └── yarn-site.xml
├── docker-compose.yml
└── start-yarn.sh
├── 3.3.6
├── Dockerfile
├── conf
│ ├── core-site.xml
│ ├── hdfs-site.xml
│ ├── mapred-site.xml
│ └── yarn-site.xml
├── docker-compose.yml
└── start-yarn.sh
├── LICENSE
└── README.md
/2.3.0/Dockerfile:
--------------------------------------------------------------------------------
1 | # Building the image using my Oracle JDK 7
2 | FROM gelog/java:openjdk7
3 |
4 | MAINTAINER Francois Langelier
5 |
6 | ENV WGET_VERSION 1.15-1ubuntu1.14.04.1
7 | # Setting HADOOP environment variables
8 | ENV HADOOP_VERSION 2.3.0
9 | ENV HADOOP_INSTALL /usr/local/hadoop
10 | ENV PATH $PATH:$HADOOP_INSTALL/bin
11 | ENV PATH $PATH:$HADOOP_INSTALL/sbin
12 | ENV HADOOP_MAPRED_HOME $HADOOP_INSTALL
13 | ENV HADOOP_COMMON_HOME $HADOOP_INSTALL
14 | ENV HADOOP_HDFS_HOME $HADOOP_INSTALL
15 | ENV HADOOP_COMMON_LIB_NATIVE_DIR $HADOOP_INSTALL/lib/native
16 | ENV YARN_HOME $HADOOP_INSTALL
17 | ENV HADOOP_CONF_DIR $HADOOP_INSTALL/etc/hadoop
18 |
19 | # Installing wget
20 | RUN \
21 | apt-get update && \
22 | apt-get install -y wget=$WGET_VERSION && \
23 | rm -rf /var/lib/apt/lists/*
24 |
25 | # Installing HADOOP
26 | RUN wget http://archive.apache.org/dist/hadoop/core/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz && \
27 | tar -zxf /hadoop-$HADOOP_VERSION.tar.gz && \
28 | rm /hadoop-$HADOOP_VERSION.tar.gz && \
29 | mv hadoop-$HADOOP_VERSION /usr/local/hadoop && \
30 | mkdir -p /usr/local/hadoop/logs
31 |
32 | # Creating symlink for HADOOP configuration files
33 | VOLUME /data
34 |
35 | # Copying default HADOOP configuration files
36 | ADD https://raw.githubusercontent.com/GELOG/docker-ubuntu-hadoop/$HADOOP_VERSION/$HADOOP_VERSION/core-site.xml $HADOOP_CONF_DIR/core-site.xml
37 | ADD https://raw.githubusercontent.com/GELOG/docker-ubuntu-hadoop/$HADOOP_VERSION/$HADOOP_VERSION/yarn-site.xml $HADOOP_CONF_DIR/yarn-site.xml
38 | ADD https://raw.githubusercontent.com/GELOG/docker-ubuntu-hadoop/$HADOOP_VERSION/$HADOOP_VERSION/mapred-site.xml $HADOOP_CONF_DIR/mapred-site.xml
39 | ADD https://raw.githubusercontent.com/GELOG/docker-ubuntu-hadoop/$HADOOP_VERSION/$HADOOP_VERSION/hdfs-site.xml $HADOOP_CONF_DIR/hdfs-site.xml
40 |
41 | CMD ["hdfs"]
--------------------------------------------------------------------------------
/2.3.0/core-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
20 |
21 | fs.default.name
22 | hdfs://hdfs-namenode:9000
23 |
24 |
25 |
--------------------------------------------------------------------------------
/2.3.0/hdfs-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
20 |
21 | dfs.replication
22 | 2
23 |
24 |
25 | dfs.datanode.data.dir
26 | file:///data/dfs/data
27 |
28 |
29 | dfs.namenode.name.dir
30 | file:///data/dfs/name
31 |
32 |
33 | dfs.namenode.checkpoint.dir
34 | file:///data/dfs/namesecondary
35 |
36 |
37 | dfs.namenode.datanode.registration.ip-hostname-check
38 | false
39 |
40 |
41 |
--------------------------------------------------------------------------------
/2.3.0/mapred-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
20 |
21 | mapreduce.framework.name
22 | yarn
23 |
24 |
25 |
--------------------------------------------------------------------------------
/2.3.0/yarn-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 | yarn.nodemanager.aux-services
18 | mapreduce_shuffle
19 |
20 |
21 | yarn.nodemanager.aux-services.mapreduce.shuffle.class
22 | org.apache.hadoop.mapred.ShuffleHandler
23 |
24 |
25 |
--------------------------------------------------------------------------------
/2.6.0/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:14.04
2 |
3 |
4 | ####################
5 | # JAVA
6 | ####################
7 |
8 | ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
9 |
10 | RUN apt-get update && \
11 | DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-7-jdk && \
12 | rm -rf /var/lib/apt/lists/*
13 |
14 |
15 |
16 | ####################
17 | # HADOOP
18 | ####################
19 |
20 | ENV HADOOP_VERSION 2.6.0
21 | ENV HADOOP_HOME /usr/local/hadoop
22 | ENV HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/native
23 | ENV PATH $PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
24 |
25 | RUN apt-get update && \
26 | DEBIAN_FRONTEND=noninteractive apt-get install -y wget libzip2 libsnappy1 libssl-dev && \
27 | wget http://archive.apache.org/dist/hadoop/core/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz && \
28 | apt-get remove -y wget && \
29 | rm -rf /var/lib/apt/lists/* && \
30 | tar -zxf /hadoop-$HADOOP_VERSION.tar.gz && \
31 | rm /hadoop-$HADOOP_VERSION.tar.gz && \
32 | mv hadoop-$HADOOP_VERSION /usr/local/hadoop && \
33 | mkdir -p /usr/local/hadoop/logs
34 |
35 |
36 | # Overwrite default HADOOP configuration files with our config files
37 | COPY conf $HADOOP_HOME/etc/hadoop/
38 |
39 | # Formatting HDFS
40 | RUN mkdir -p /data/dfs/data /data/dfs/name /data/dfs/namesecondary && \
41 | hdfs namenode -format
42 | VOLUME /data
43 |
44 |
45 | # Helper script for starting YARN
46 | ADD start-yarn.sh /usr/local/bin/start-yarn.sh
47 |
48 |
49 |
50 | ####################
51 | # PORTS
52 | ####################
53 | #
54 | # http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_HDP_Reference_Guide/content/reference_chap2.html
55 | # http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/cdh_ig_ports_cdh5.html
56 | # http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/core-default.xml
57 | # http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml
58 |
59 | # HDFS: NameNode (NN):
60 | # 8020 = fs.defaultFS (IPC / File system metadata operations)
61 | # (9000 is also frequently used alternatively)
62 | # 8022 = dfs.namenode.servicerpc-address (optional port used by HDFS daemons to avoid sharing RPC port)
63 | # 50070 = dfs.namenode.http-address (HTTP / NN Web UI)
64 | # 50470 = dfs.namenode.https-address (HTTPS / Secure UI)
65 | # HDFS: DataNode (DN):
66 | # 50010 = dfs.datanode.address (Data transfer)
67 | # 50020 = dfs.datanode.ipc.address (IPC / metadata operations)
68 | # 50075 = dfs.datanode.http.address (HTTP / DN Web UI)
69 | # 50475 = dfs.datanode.https.address (HTTPS / Secure UI)
70 | # HDFS: Secondary NameNode (SNN)
71 | # 50090 = dfs.secondary.http.address (HTTP / Checkpoint for NameNode metadata)
72 | EXPOSE 9000 50070 50010 50020 50075 50090
73 |
74 |
75 |
76 | CMD ["hdfs"]
77 |
--------------------------------------------------------------------------------
/2.6.0/conf/core-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
20 |
21 | fs.default.name
22 | hdfs://hdfs-namenode:9000
23 |
24 |
25 |
--------------------------------------------------------------------------------
/2.6.0/conf/hdfs-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
20 |
21 | dfs.replication
22 | 2
23 |
24 |
25 | dfs.datanode.data.dir
26 | file:///data/dfs/data
27 |
28 |
29 | dfs.namenode.name.dir
30 | file:///data/dfs/name
31 |
32 |
33 | dfs.namenode.checkpoint.dir
34 | file:///data/dfs/namesecondary
35 |
36 |
37 | dfs.namenode.datanode.registration.ip-hostname-check
38 | false
39 |
40 |
41 |
--------------------------------------------------------------------------------
/2.6.0/conf/mapred-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
20 |
21 | mapreduce.framework.name
22 | yarn
23 |
24 |
25 |
--------------------------------------------------------------------------------
/2.6.0/conf/yarn-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 | yarn.nodemanager.aux-services
18 | mapreduce_shuffle
19 |
20 |
21 | yarn.nodemanager.aux-services.mapreduce.shuffle.class
22 | org.apache.hadoop.mapred.ShuffleHandler
23 |
24 |
25 | yarn.resourcemanager.hostname
26 | yarn
27 |
28 |
29 | yarn.nodemanager.hostname
30 | yarn
31 |
32 |
33 |
--------------------------------------------------------------------------------
/2.6.0/docker-compose.yml:
--------------------------------------------------------------------------------
1 | namenode:
2 | image: gelog/hadoop
3 | ports:
4 | - "50070:50070"
5 | command: hdfs namenode
6 | hostname: hdfs-namenode
7 |
8 | datanode:
9 | image: gelog/hadoop
10 | command: hdfs datanode
11 | ports:
12 | # The host port is randomly assigned by Docker, to allow scaling to multiple DataNodes on the same host
13 | - "50075"
14 | links:
15 | - namenode:hdfs-namenode
16 |
17 | secondarynamenode:
18 | image: gelog/hadoop
19 | command: hdfs secondarynamenode
20 | ports:
21 | - "50090:50090"
22 | links:
23 | - namenode:hdfs-namenode
24 |
--------------------------------------------------------------------------------
/2.6.0/start-yarn.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | yarn resourcemanager&
4 | yarn nodemanager
5 |
--------------------------------------------------------------------------------
/3.3.6/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:23.10
2 |
3 |
4 | ####################
5 | # JAVA
6 | ####################
7 |
8 | ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
9 |
10 | RUN apt-get update && \
11 | DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-8-jdk && \
12 | rm -rf /var/lib/apt/lists/*
13 |
14 |
15 |
16 | ####################
17 | # HADOOP
18 | ####################
19 |
20 | ENV HADOOP_VERSION 3.3.6
21 | ENV HADOOP_HOME /usr/local/hadoop
22 | ENV HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/native
23 | ENV PATH $PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
24 |
25 | ENV YARN_RESOURCEMANAGER_USER root
26 | #ENV HADOOP_SECURE_DN_USER root
27 | ENV YARN_NODEMANAGER_USER root
28 |
29 | RUN apt-get update && \
30 | DEBIAN_FRONTEND=noninteractive apt-get install -y wget libzip4 libsnappy1v5 libssl-dev && \
31 | wget http://archive.apache.org/dist/hadoop/core/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz && \
32 | apt-get remove -y wget && \
33 | rm -rf /var/lib/apt/lists/* && \
34 | tar -zxf /hadoop-$HADOOP_VERSION.tar.gz && \
35 | rm /hadoop-$HADOOP_VERSION.tar.gz && \
36 | mv hadoop-$HADOOP_VERSION /usr/local/hadoop && \
37 | mkdir -p /usr/local/hadoop/logs
38 |
39 |
40 | # Overwrite default HADOOP configuration files with our config files
41 | COPY conf $HADOOP_HOME/etc/hadoop/
42 |
43 | # Formatting HDFS
44 | RUN mkdir -p /data/dfs/data /data/dfs/name /data/dfs/namesecondary && \
45 | hdfs namenode -format
46 | VOLUME /data
47 |
48 |
49 | # Helper script for starting YARN
50 | ADD start-yarn.sh /usr/local/bin/start-yarn.sh
51 |
52 |
53 |
54 | ####################
55 | # PORTS
56 | ####################
57 | #
58 | # http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0/bk_HDP_Reference_Guide/content/reference_chap2.html
59 | # http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/cdh_ig_ports_cdh5.html
60 | # http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/core-default.xml
61 | # http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml
62 |
63 | # HDFS: NameNode (NN):
64 | # 9820 = fs.defaultFS (IPC / File system metadata operations)
65 | # (9000 is also frequently used alternatively)
66 | # 9871 = dfs.namenode.https-address (HTTPS / Secure UI)
67 | # 9870 = dfs.namenode.https-address (HTTPS / Secure UI)
68 | # HDFS: DataNode (DN):
69 | # 9866 = dfs.datanode.address (Data transfer)
70 | # 9867 = dfs.datanode.ipc.address (IPC / metadata operations)
71 | # 9864 = dfs.datanode.https.address (HTTPS / Secure UI)
72 | # HDFS: Secondary NameNode (SNN)
73 | # 9868 = dfs.secondary.http.address (HTTP / Checkpoint for NameNode metadata)
74 | EXPOSE 9000 9870 9866 9867 9864 9868 8088
75 |
76 |
77 |
78 | CMD ["hdfs"]
79 |
--------------------------------------------------------------------------------
/3.3.6/conf/core-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
20 |
21 | fs.default.name
22 | hdfs://hdfs-namenode:9000
23 |
24 |
25 |
--------------------------------------------------------------------------------
/3.3.6/conf/hdfs-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
20 |
21 | dfs.replication
22 | 2
23 |
24 |
25 | dfs.datanode.data.dir
26 | file:///data/dfs/data
27 |
28 |
29 | dfs.namenode.name.dir
30 | file:///data/dfs/name
31 |
32 |
33 | dfs.namenode.checkpoint.dir
34 | file:///data/dfs/namesecondary
35 |
36 |
37 | dfs.namenode.datanode.registration.ip-hostname-check
38 | false
39 |
40 |
41 |
42 | dfs.permissions
43 | false
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/3.3.6/conf/mapred-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
20 |
21 | mapreduce.framework.name
22 | yarn
23 |
24 |
25 |
26 | yarn.app.mapreduce.am.env
27 | HADOOP_MAPRED_HOME=${HADOOP_HOME}
28 |
29 |
30 | mapreduce.map.env
31 | HADOOP_MAPRED_HOME=${HADOOP_HOME}
32 |
33 |
34 | mapreduce.reduce.env
35 | HADOOP_MAPRED_HOME=${HADOOP_HOME}
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/3.3.6/conf/yarn-site.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 | yarn.nodemanager.aux-services
18 | mapreduce_shuffle
19 |
20 |
21 | yarn.nodemanager.aux-services.mapreduce.shuffle.class
22 | org.apache.hadoop.mapred.ShuffleHandler
23 |
24 |
25 | yarn.resourcemanager.hostname
26 | hdfs-namenode
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/3.3.6/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.7"
2 | services:
3 | namenode:
4 | image: cjj2010/hadoop:3.3.6
5 | ports:
6 | - "9870:9870"
7 | - "8088:8088"
8 | command: >
9 | bash -c "hdfs namenode & yarn resourcemanager "
10 | hostname: hdfs-namenode
11 |
12 | datanode:
13 | image: cjj2010/hadoop:3.3.6
14 | hostname: datanode
15 | depends_on:
16 | - namenode
17 | command: >
18 | bash -c "hdfs datanode & yarn nodemanager "
19 | ports:
20 | # The host port is randomly assigned by Docker, to allow scaling to multiple DataNodes on the same host
21 | - "9864"
22 | links:
23 | - namenode:hdfs-namenode
24 |
25 |
26 | secondarynamenode:
27 | image: cjj2010/hadoop:3.3.6
28 | command: hdfs secondarynamenode
29 | ports:
30 | - "9868:9868"
31 | links:
32 | - namenode:hdfs-namenode
33 |
--------------------------------------------------------------------------------
/3.3.6/start-yarn.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | yarn resourcemanager&
4 | yarn nodemanager
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Docker image for Hadoop
2 | 
3 |
4 | [  ](https://github.com/gelog/docker-ubuntu-hadoop)
5 |
6 | ## Supported tags and respective `Dockerfile` links
7 | - [`2.6.0`/Dockerfile](https://github.com/GELOG/docker-ubuntu-hadoop/tree/2.6.0/Dockerfile)
8 | - [`2.5.2`/Dockerfile](https://github.com/GELOG/docker-ubuntu-hadoop/tree/2.5.2/Dockerfile)
9 | - [`2.5.1`/Dockerfile](https://github.com/GELOG/docker-ubuntu-hadoop/tree/2.5.1/Dockerfile)
10 | - [`2.5.0`/Dockerfile](https://github.com/GELOG/docker-ubuntu-hadoop/tree/2.5.0/Dockerfile)
11 | - [`2.4.1`/Dockerfile](https://github.com/GELOG/docker-ubuntu-hadoop/tree/2.4.1/Dockerfile)
12 | - [`2.4.0`/Dockerfile](https://github.com/GELOG/docker-ubuntu-hadoop/tree/2.4.0/Dockerfile)
13 | - [`2.3.0`/Dockerfile](https://github.com/GELOG/docker-ubuntu-hadoop/tree/2.3.0/Dockerfile)
14 |
15 |
16 | ## What is Hadoop?
17 | The Apache™ Hadoop® project develops open-source software for reliable, scalable, distributed computing.
18 |
19 | The Apache Hadoop software library is a framework that allows for the distributed processing of large data sets across clusters of computers using simple programming models. It is designed to scale up from single servers to thousands of machines, each offering local computation and storage. Rather than rely on hardware to deliver high-availability, the library itself is designed to detect and handle failures at the application layer, so delivering a highly-available service on top of a cluster of computers, each of which may be prone to failures.
20 |
21 | [http://hadoop.apache.org/](http://hadoop.apache.org/)
22 |
23 |
24 | ## What is Docker?
25 | Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows, Docker enables apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments. As a result, IT can ship faster and run the same app, unchanged, on laptops, data center VMs, and any cloud.
26 |
27 | [https://www.docker.com/whatisdocker/](https://www.docker.com/whatisdocker/)
28 |
29 | ### What is a Docker Image?
30 | Docker images are the basis of containers. Images are read-only, while containers are writeable. Only the containers can be executed by the operating system.
31 |
32 | [https://docs.docker.com/terms/image/](https://docs.docker.com/terms/image/)
33 |
34 |
35 | ## How to use this image?
36 |
37 |
38 | ### Starting the NameNode
39 | This command starts a container for the HDFS NameNode in the background, and starts tailing its logs.
40 |
41 | docker run -d --name hdfs-namenode \
42 | -h hdfs-namenode -p 50070:50070 \
43 | gelog/hadoop hdfs namenode && \
44 | docker logs -f hdfs-namenode
45 |
46 | If everything looks good in the logs (no errors), hit `CTRL + C` to detach the console from the logs.
47 |
48 |
49 | ### Starting a DataNode
50 | This command starts a separate container for the HDFS DataNode in the background, link it with the NameNode container, and starts tailing its logs.
51 |
52 | docker run -d --name hdfs-datanode1 \
53 | -h hdfs-datanode1 -p 50075:50075 \
54 | --link=hdfs-namenode:hdfs-namenode \
55 | gelog/hadoop hdfs datanode && \
56 | docker logs -f hdfs-datanode1
57 |
58 | If everything looks good in the logs (no errors), hit `CTRL + C` to detach the console from the logs.
59 |
60 |
61 | ### Starting a Secondary NameNode
62 | This command starts a separate container for the HDFS Secondary NameNode in the background, link it with the NameNode container, and starts tailing its logs.
63 |
64 | docker run -d --name hdfs-secondarynamenode \
65 | -h hdfs-secondarynamenode -p 50090:50090 \
66 | --link=hdfs-namenode:hdfs-namenode \
67 | gelog/hadoop hdfs secondarynamenode && \
68 | docker logs -f hdfs-secondarynamenode
69 |
70 | If everything looks good in the logs (no errors), hit `CTRL + C` to detach the console from the logs.
71 |
72 |
73 | ### Starting YARN
74 | This command starts a container for the YARN system in background. It links with the NameNode, the Datanode.
75 | The start-yarn.sh script starts a YARN Node manager and a YARN Resource Manager.
76 |
77 | ```
78 | docker run -d --name yarn \
79 | -h yarn \
80 | -p 8088:8088 \
81 | -p 8042:8042 \
82 | --link=hdfs-namenode:hdfs-namenode \
83 | --link=hdfs-datanode1:hdfs-datanode1 \
84 | -v $HOME/data/hadoop/hdfs:/data \
85 | gelog/hadoop start-yarn.sh && \
86 | docker logs -f yarn
87 | ```
88 |
89 |
90 |
91 | ### Submit a Map Reduce job
92 |
93 | #### Put some data in HDFS
94 | ```
95 | docker run --rm \
96 | --link=hdfs-namenode:hdfs-namenode \
97 | --link=hdfs-datanode1:hdfs-datanode1 \
98 | gelog/hadoop \
99 | hadoop fs -put /usr/local/hadoop/README.txt /README.txt
100 | ```
101 | #### Start wordcount example
102 |
103 | This runs the word count example.
104 | ```
105 | docker run --rm \
106 | --link yarn:yarn \
107 | --link=hdfs-namenode:hdfs-namenode \
108 | gelog/hadoop \
109 | hadoop jar /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar wordcount /README.txt /README.result
110 |
111 | ```
112 |
113 | If README.result already exists you need to remove it prior running the map reduce job.
114 |
115 | ```
116 | docker run --rm --link=hdfs-namenode:hdfs-namenode \
117 | --link=hdfs-datanode1:hdfs-datanode1 \
118 | gelog/hadoop \
119 | hadoop fs -rm -R -f /README.result
120 | ```
121 |
122 |
123 | #### Check the result
124 | ```
125 | docker run --rm --link=hdfs-namenode:hdfs-namenode \
126 | --link=hdfs-datanode1:hdfs-datanode1 \
127 | gelog/hadoop \
128 | hadoop fs -cat /README.result/\*
129 | ```
130 |
131 | ### Accessing the web interfaces
132 | Each component provide its own web UI. Open you browser at one of the URLs below, where `dockerhost` is the name / IP of the host running the docker daemon. If using Linux, this is the IP of your linux box. If using OSX or Windows (via Boot2docker), you can find out your docker host by typing `boot2docker ip`. On my machine, the NameNode UI is accessible at `http://192.168.59.103:50070/`
133 |
134 | | Component | Port |
135 | | ----------------------- | -------------------------------------------------- |
136 | | HDFS NameNode | [http://dockerhost:50070](http://dockerhost:50070) |
137 | | HDFS DataNode | [http://dockerhost:50075](http://dockerhost:50075) |
138 | | HDFS Secondary NameNode | [http://dockerhost:50090](http://dockerhost:50090) |
139 | | YARN Resource Manager | [http://dockerhost:8088](http://dockerhost:8088) |
140 | | YARN Node Manager | [http://dockerhost:8042](http://dockerhost:8042) |
141 |
142 |
143 | ## Use this image using docker-compose
144 | Note: your terminal need to be in the folder where the docker-compose.yml is located.
145 |
146 | You can start this image using docker-compose. It will start a namenode, a secondary nanenode and a datanode. You have the possibility to scale the datanode.
147 |
148 | ### Starting the image with basic setting
149 | docker-compose up -d && \
150 | docker-compose logs
151 |
152 | If everything looks good in the logs (no errors), hit `CTRL + C` to detach the console from the logs.
153 |
154 | ### Scaling the datanode
155 | If you want to increase the number of datanode in your cluster
156 |
157 | docker-compose scale datanode=
158 |
159 | ### Finding the port for web access
160 | To allow the datanode to scale, we need to let docker decide the port used on the host machine. To find which port it is
161 |
162 | docker-compose port datanode 50075
163 |
164 | With this port, you can access the web interfaces of the datanode.
165 |
166 |
167 |
--------------------------------------------------------------------------------