MapReduce program Local mode debugging

Source: Internet
Author: User
Keywords Configure environment variables local mode debugging MapReduce programs HDFS files
Tags configure debugging eclipse environment environment variables file files framework
1. Material

No jar version Windows platform Hadoop-2.6.1.zip

Eclipse

Extract

2. Configure Environment Variables

3. Local mode operation local file

Conf.set ("Mapreduce.framework.name", "local");
Conf.set ("Fs.defaultfs", "file:///");

Run parameters

The result was a successful run.

4. Local mode operation HDFs file

Conf.set ("Mapreduce.framework.name", "local");
System.setproperty ("Hadoop_user_name", "HADOOP");
Conf.set ("Fs.defaultfs", "hdfs://hadoop01:9000");

The result was a successful run.

4.1 Error org.apache.hadoop.security.AccessControlException:Permission Denied:user=admin, Access=write, inode= "/ WordCount ": hadoop:supergroup:drwxr-xr-x

Not add System.setproperty ("Hadoop_user_name", "HADOOP");

4.2Exception in thread ' main ' java.lang.illegalargumentexception:pathname/c:/wordcount/output6666 from hdfs:// hadoop01:9000/c:/wordcount/output6666 is not a valid DFS filename

You are using a local HDFs file, but write a local path, the solution: console input parameters replaced by the HDFs file path 5. Summary of local run mode

(1) The MapReduce program is to be submitted to the Localjobrunner in the form of a single process

(2) The processing of data and output can be in the local file system, can also be on the HDFs

(3) How to achieve local operation? Write a program that does not have a clustered configuration file (essentially whether there are mapreduce.framework.name=local and Yarn.resourcemanager.hostname parameters in the Conf of your Mr Program)

(4) Local mode is very easy to debug business logic, as long as you interrupt in eclipse

If you want to run local mode to test program logic under Windows, you need to configure the environment variables in Windows:

%hadoop_home% = d:/hadoop-2.6.1

%PATH% =%hadoop_home%\bin

And to replace the d:/hadoop-2.6.1 Lib and bin directories with the version of the Windows platform compilation

Related Article

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.