First, a brief introduction of the next blogger's configuration environment
- MAC 10.10.0
- Hadoop 2.6
- JDK 1.6 (can be queried in the shell using jdk-version)
Hadoop installation
It is recommended to use the brew under the MAC for installation, the reason is to use brew installation, it will automatically help you configure the appropriate path. Of course, you can download it on the official website and note that the JDK and Hadoop versions correspond.
install hadoop
Once installed, you can use the Brew list Hadoop to view it.
The location should be in:/usr/local/cellar/hadoop/
It is not convenient to execute Hadoop commands directly in the shell at this time.
Executive WordCount
First of all, the wordcount to be executed now is just a simple test of whether Hadoop can work, not multithreaded pseudo-distributed, because there is no configuration, this next section will say.
-
1. First we set up the following data sources
-
under the Hadoop root directory, create a folder called "Input"
-
put the TXT data in it, and I'll just copy the "Readme.txt" into it.
-
2. Now we can execute Hadoop's own commands.
The
-
first thing to do is to find the path to the
hadoop-mapreduce-examples-2.6.0.jar file, since the examples are all in this.
-
execute with the
Jar command because it is written in Java.
3. Execution of commands
hadoop jar /usr/local/Cellar/hadoop/2.6.0/libexec/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar wordcount input output
-
4. Effects
-
you'll find the shell popping a bunch of things.
-
it will eventually generate an output folder with something open and that is WordCount
This article comes from the blog "Bo Li Garvin"
Reprint please indicate source: Http://blog.csdn.net/buptgshengod
hadoop2.6 installation and execution wordcount under "Hadoop" Mac