Build a Sqoop Eclipse debugging environment

Source: Internet
Author: User
Tags sqoop
A, import to Sqoop to eclipse: Download Sqoop 1.3 of the TAR package decompression, we open the Build.xml, found <target name= "Eclipse" description= "Generate Eclipse Project > Target, we just need to execute ant Eclipse, and the ant script can give us an Eclipse engineering file, and we'll just have to import it in Eclipse.
B, Debug Sqoop: Because the Sqoop Bin folder in the script, Sqoop to start the Java process, the Java process is Sqoop script subprocess, Sqoop scripts configured in many of the environment variables need to be uploaded to the Sqoop program, so direct, The main function executes in eclipse and cannot be executed, so the Java process needs to be debugged remotely.
C, how to do Java process debugging: Open Bin\sqoop, the last line, found that
exec ${hadoop_home}/bin/hadoop Com.cloudera.sqoop.Sqoop "$@", execute this sentence, description of the implementation of the Hadoop script, to remote debugging, we need to add in the Hadoop script, we debug parameters And I added that in the Hadoop script,
hadoop_debug= "-xdebug-xrunjdwp:transport=dt_socket,address=9991,server=y,su spend=y" and then add this option to the script in the following line, So you can debug remotely.
For example, I perform./sqoop import--connect jdbc:mysql://localhost/test--username root--password root--table STUDENT, function to import the data from the student table into the HDFs, after adding debugging options, the process will stop, we only need eclipse for remote debugging, as our local code is the same, you can break the point, you can see the value of variables, very convenient, specific eclipse remote debugging can be referenced, http://www.ibm.com/developerworks/cn/opensource/os-eclipse-javadebug/, you can. Then you can learn its source code.
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.