We have built a pseudo-distributed Hadoop runtime environment in front of us.
Most of us are accustomed to Java development in eclipse or MyEclipse, and this essay teaches you how to build a Hadoop development environment based on the MyEclipse IDE.
Talk less, walk up!
first step to install the MyEclipse Hadoop plugin
1 Open MyEclipse to see if it has been installed
Window-Preferences
The Hadoop map/reduce is not shown, so the myeclipse is a plugin that has no eclipse installed.
First, make sure that you have JDK and Eclipse or MyEclipse installed on your local Windows and can develop Java programs.
2. Download Eclipse's Hadoop plugin hadoop-eclipse-plugin-2.2.0
Put the downloaded JAR file in the installed MyEclipse 10\dropins directory and restart the myeclipse.
After the restart, the following screen will appear, click OK,
That is, Hadoop Map/reduce appears, indicating success.
The second step is to set up the local Hadoop installation run directory
1, Hadoop-2.2.0-x64.rar download
First, it is clear that the local JDK is a 64-bit version, so you need to download the corresponding bit of Hadoop run package. In fact, it is also consistent with the Hadoop runtime package and JDK in CentOS6.5.
2. Unzip the downloaded package and store it in one of the directories you want, for example: D:\Software\hadoop-2.2.0
Restart MyEclipse, menu in Windows-Preferences
will have one more item for Hadoop Map/reduce. Click this to select your Hadoop storage directory on the right (D:\Software\hadoop-2.2.0)
Before extracting,
After decompression,
3. Configure Environment variables
new environment variable hadoop_home, variable value is D:\Software\hadoop-2.2.0
Modify the PATH variable to add:
;D: \software\hadoop-2.2.0\bin Note semicolon
4. Add Map/reduce Location
Switch eclipse/myeclipse to Map/reduce view,
The Map/reduce locations entry appears in the bottom operation area, as shown in:
Click on the right mouse button in the area shown or click on it as shown, then new Hadoop location.
In the pop-up interface, do the following:
50020-50070
50040-> 9000
Zhouls, Hadoop
5, sbin/start-all.sh, then JPS
6, click Windowsàshow View, Project Exploer, you can appear the following
This shows that Hadoop and the local myeclipse build successfully.
7. New MapReduce Project
Below, create a new
Project, File-New
New Package
SRC--New Package
Class New
Take a look at WordCount's own program:
Before the change, it was
After the change, it is
Then, Windows--Show view--
Run the next program.
Then, execute the Wordcount.java
Refresh, Query the results
This statistic is consistent with the previous results.
That means building a myeclipse-based Hadoop development environment has been successful!
Build a Hadoop development environment based on MyEclipse