יום ראשון, 16 ביוני 2013

Compile hadoop jar using NetBeans

I have compiled the Hadoop WordCount sample using NetBeans.
Compiling Hadoop jar using netbeans is very simple procedure.
Create a simple Java SE project and include the map reduce code i
Include the Hadoop-core-1.1.2. jars in the project path

5

Set the main in the main class correctly


4

Build the project and copy the Jar to your execution directory (local not in the HDFS ).

Creating the Directories in the HDFS
zvika@ubuntu:~/myStaff/Hadoop/hadoop-1.1.2$ bin/hadoop dfs -mkdir /tmp/hadoop-zvika/Input
zvika@ubuntu:~/myStaff/Hadoop/hadoop-1.1.2$ bin/hadoop dfs -mkdir /tmp/hadoop-zvika/output

Copy the Test Data from local HD to HDFS
hadoop dfs -copyFromLocal myTestFiles/input1  /tmp/hadoop-zvika/Input

Executing the jar file
zvika@ubuntu:~/myStaff/Hadoop/hadoop-1.1.2$ bin/hadoop jar MyWordCount.jar  /tmp/hadoop-zvika/Input /tmp/hadoop-zvika/Output

The job report
3

The Results

1

אין תגובות:

הוסף רשומת תגובה