hadoop2.x Eclipse under Programming environment configuration

Source: Internet
Author: User

This process is for how to write hadoop2.x corresponding mapreduce programs in Eclipse and then package them and upload them to the Hadoop cluster execution process.



1. Download the hadoop2.x tar package and extract it to a directory ( Note: Not a source package, it is an installation package )



2. Import the Hadoop2x-eclipse plugin into eclipse:

(1) Compile the plugin. Plugin Source Address Https://github.com/winghc/hadoop2x-eclipse-plugin

(2) Copy the compiled Hadoop2x-eclipse*.jar package to the Eclipse/plugins directory

(3) Restart Eclipse

(4) Eclipse-> windows-> Open Perspective opens the MapReduce view

(5) eclipse-> windows->preferences-> Hadoop MapReduce, configure the Hadoop installation path, point to 1 in the directory after extracting the Hadoop tar package.

3. Create a MapReduce project

(1) Create project: eclipse-> file-> new-> map/reduce project. After the project is created, a series of dependent jar packages, including hadoop-hdfs*, hadoop-yarn* and so on, are found in the project directory. If not, then write the code will be error, you need to manually import.


A series of jar packages that you will see in the project:

(2) You can then start the development. The map or reduce file created by new-> Mapper/reducer/driver in the project will automatically generate references, inheritance, and structure, and only need to add the implementation.

The structure has automatically generated a good map file:


4. Package, upload to cluster, run

(1) eclipse-> file-> export-> Jar File. Export JAR Package

(2) Upload the jar package to the cluster and run:

Hadoop jar Wordcount.jar org.apache.hadoop.wordcount arg0 arg1 ...





Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

hadoop2.x Eclipse under Programming environment configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.