Execute Hadoop WordCount in Eclipse

Source: Internet
Author: User

Execute Hadoop WordCount in Eclipse

Preliminary work

My Eclipse is installed in Windows. To connect to Hadoop through Eclipse, you need to keep the access address of the virtual machine in the same domain as the access address of the local machine, the previous article introduced how to change the address of a virtual machine. To change the IP address of a windows host, open "network and sharing center" and click "Change adapter Settings" in the left-side menu. select the corresponding connection network to modify the IpV4 attribute address. My VM address is 192.168.3.small.

Preparations

After the address is configured, install the Hadoop plug-in on Eclipse (you can refer to the source code to modify it yourself ).

Open the Eclipse installation path --- \ eclipse \ plugins, put the hadoop-eclipse-plugin-1.1.2.jar under this directory.

Create a new directory on the windows machine (I am in E: \ hadoopMapReduceDir), copy all the jar files from the Hadoop installation package in Linux and put them in this directory for backup.

Build a Hadoop environment on Ubuntu 13.04

Cluster configuration for Ubuntu 12.10 + Hadoop 1.2.1

Build a Hadoop environment on Ubuntu (standalone mode + pseudo Distribution Mode)

Configuration of Hadoop environment in Ubuntu

Detailed tutorial on creating a Hadoop environment for standalone Edition

Build a Hadoop environment (using virtual machines to build two Ubuntu systems in a Winodws environment)

Configuration

Open Eclipse, click Window in the menu bar, and select Other in showView to open the selection Window, as shown below:

 

Find the elephant in the MapReduceTools directory and drag it to the bottom of Eclipse for display (with the Console)

 

Click the elephant, right-click in the blank area, and select New Hadooplocation (SEE)

 

Open the new configuration window and set the connection information. Set the connection configuration name of the Local Machine and the two ports and usernames as shown in the figure (Hadoop default port)

 

Click "Window ---" Preference "in the Eclipse menu bar, find" HadoopMap/Reduce ", click" Import Hadoop jar path "on the right, and then create a Hadoop project. The jar package is automatically loaded from this path, path set above, add in

 

Create a project

Click File ---> other to open the new dialog box and create the Map/ceceproject project NewHadoopTest.

 

After the jar package is created, it is automatically loaded into the project.

 

Copy the example java project under the src directory of Hadoop in Linux to src under the project just created,

There is WordCount. java

Start Hadoop in Linux (use JPS to check whether Hadoop has been started). Connect to Hadoop in Eclipse. After the connection is successful, the Hadoop directory will display the following

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.