Project

General

Profile

Sample-hadoop-basic » History » Version 4

Henning Blohm, 20.09.2012 15:26

1 1 Henning Blohm
h1. A simple Hadoop with Z2 sample
2
3 2 Henning Blohm
This sample is an adaptation of the classical Wordcount sample in the Z2 context. This sample is supposed to show you how Hadoop can be used from within Z2 and in particular how to write Map/Reduce jobs in that context. 
4
5
*Note #1:* This sample is made to be run on Linux or Mac-OS. Supposedly it is possible to run Hadoop on Windows. Sorry, but we have not been able to adapt the sample yet.
6 4 Henning Blohm
*Note #2:* For your convenience everything in this sample assumes you use Eclipse. That as such is of course no prerequisite to running the software, but it just makes everything much more integrated for now. Please have Eclipse ready and the Eclipsoid installed. See [[How to install Eclipsoid]]. 
7 1 Henning Blohm
8 4 Henning Blohm
This sample is provided by the repository "z2-samples-hadoop-basic":http://redmine.z2-environment.net/projects/z2-samples/repository/z2-samples-hadoop-basic.
9 3 Henning Blohm
10 2 Henning Blohm
h2. Prerequisites
11
12 1 Henning Blohm
This sample makes use of the [[Hadoop add-on]] that is based on Cloudera's CDH4 distribution of Hadoop. As client access is version dependent, so is the sample. In order to simplify this for you, there is a pre-configured CDH4 distribution available to you from this site. Apart from its development style configuration (i.e. no security), this is anyway the way we prefer to install Hadoop and friends: Just one root installation folder, one OS user, one log folder etc.
13
14 3 Henning Blohm
Please follow the procedure described here: [[Install prepack CDH4]].
15
16
To use with this sample, it is most convenient, if you clone and configure the CDH4 install next to your Eclipse workspace and the sample repository clone.
17
18 1 Henning Blohm
h2. Setting up the sample
19
20 4 Henning Blohm
From here on, the sample is run like all samples, that is, following [[How to run a sample]].
21
22
Assuming everything (including the CDH4 setup) is under *install* and your workspace in in *install/workspace* please clone "z2-samples-hadoop-basic":http://redmine.z2-environment.net/projects/z2-samples/repository/z2-samples-hadoop-basic under *install* as well. Either from the command line as 
23
24
<pre><code class="ruby">
25
cd install
26
git clone -b master http://git.z2-environment.net/z2-samples.hadoop-basic
27
</code></pre>
28
29
or from within Eclipse using the Git repositories view (but make sure the folder is right next to your z2-base.core clone).
30
31
You should have an Eclipse workspace and next to it *z2-samples.hadoop-basic*, *z2-samples.cdh4-base*, and *z2-base.core*. Import all projects into your workspace.
32
33
We assume that you followed the steps in [[Install prepack CDH4]] and Hadoop is running (we do not need HBase in this case).