Development of Hadoop in the context of Java environments
Since the MapReduce program has been written in the form of Hadoop streaming, the current Hadoop program is limited to the Python language. In order to expand the Java language development, this experiment uses window System, MAVEN packaging, CentOS system MAPR environment operation.
Two steps
1 View hadoop versions, command Hadoop version, get version number hadoop2.7.0
2 Write POW files, note hadoop2.7 dependencies,
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>Hadoop-client</artifactid>
<version>2.7.0</version>
</dependency>
3 Writing Java version of the WordCount project (specific Java code slightly)
4 maven Install download the dependency package and compile it into a jar package, and test the jar package to the cluster in target.
Enter a command to run the project in a 5MAPR cluster:
Hadoop jar Maven-hadoop-java-wordcount-template-0.0.1-snapshot.jar com.example.Driver Input Output
6 experimental results.
Run successfully, 1
2
Three appendices
The path structure of the project in eclipse
I put the project source on GitHub
Https://github.com/rongyux/Hadoop_Maven_Java_HellloWorld
Hadoop Combat 5:mapreduce Programming-wordcount count Words-eclipse-java-windows Environment