Eclipse Remote Debugging MapReduce

Source: Internet
Author: User
Tags xsl

Working environment: Centos6.5+eclipse (4.4.2) +hadoop2.7.0

1. Download the Eclipse Hadoop plugin Hadoop-eclipse-plugin-2.7.0.jar paste into the Eclipse directory under plugins to restart Eclipse

2. Choose Windows-->showview-->other-->mapreduce Tool-->map/reduce in eclipse locations

3. After selecting the previous step, eclipse will have a map/reduce locations tab in the lower right corner, right-click on the-->new Hadoop locations and configure as shown:

4, configure Hadoop/etc/hadoop/mapred-site.xml, add the following information in <configuration></configuration>

<property>      <name>mapred.map.child.java.opts</name>       <value>-xmx1024m-xdebug- xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8883</value>  </property>  <property>      <name>mapred.tasktracker.map.tasks.maximum</name>      <value>1 </value>  </property>  

Mapred-site.xml complete information after the Append

<?xml version="1.0"? ><?xml-stylesheet type="text/xsl"href="configuration.xsl"?><!--Put Site-specific property overridesinch  ThisFile. --><configuration><property> <name>mapreduce.framework.name</name> <value>y               arn</value> </property> <property> <name>mapred.map.child.java.opts</name> <value>-xmx1024m-xdebug-xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8883</value> </property> <property> <name>mapred.tasktracker.map.tasks.maximum </name> <value>1</value> </property> </configuration>

Mapred-site.xml complete information after the Append

<?xml version="1.0"? ><?xml-stylesheet type="text/xsl"href="configuration.xsl"?><!--Put Site-specific property overridesinch  ThisFile. --><configuration>
<property> <name>mapreduce.framework.name</name> <value>yarn</value> </p Roperty>
<property> <name>mapred.map.child.java.opts</name> <value>-xmx1024m-xdebug -xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8883</value> </property>
<property> <name>mapred.tasktracker.map.tasks.maximum</name> <value>1</value> </property> <property> <name>mapred.reduce.child.java.opts</name> <value>-xmx1024m-xdebug-xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8884</value> </property>
<property> <name>mapred.tasktracker.reduce.tasks.maximum</name> <value>1</value> </property>
</configuration>

Execution: Hadoop jar Xxx.jar Words.txt/wordsout

After submission, the job will stop at the time of map 0% reduce 0% and wait for the debugger of remote debugging.

at this time in Eclipse-->debug as-->remote Java appplicetion:contention proteties ip:127.0.0.1[According to the situationfill in the actual ip],port: 8883[the port configured above] apply debug

You can then go inside the map function.

5. Debugging the Reduce task

Configure Hadoop/etc/hadoop/mapred-site.xml, add the following information to <configuration></configuration>

<property>      <name>mapred.reduce.child.java.opts</name>      <value>-xmx1024m-xdebug- xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8884</value>  </property>  <property>      <name>mapred.tasktracker.reduce.tasks.maximum</name>      <value>1 </value>  

Execution: Hadoop jar Xxx.jar Words.txt/wordsout

Submitting Job,job later will stop at the time of map 100% reduce 0% and wait for the debugger of remote debugging.

At this point in Eclipse-->debug as-->remote Java appplicetion:contention proteties ip:127.0.0.1[fill in the actual ip],port as appropriate:8884[ Ports configured above] apply debug

You can then enter the reduce function.

This article is basically configured based on the Hadoop pseudo-deployment

Reference article: http://blog.csdn.net/gjt19910817/article/details/30384685

Eclipse Remote Debugging MapReduce

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.