- Create a maven project using m2eclipse.
- Add org.apache.hadoop:hadoop-core as dependency.
- You can set breakpoint at any line in your code.
- Right-click your drive class, Debug As -> Java Application
- In arguments tab of launch configuration, put "-fs file:/// -jt local -Dmapred.local.dir=c:/temp/hadoop your_input_file c:/temp/hadoop/output" in "Program arguments"
- If you run on Windows, you have to use Cygwin because hadoop uses external shell command "chmod". In Environment tab, add environment variable PATH, value is ${env_var:path};c:\cygwin\bin. Then hadoop can find chmod.
- Click debug, you can debug your MapReduce code in eclipse. Hadoop is running in local mode.
Friday, August 19, 2011
How to debug Hadoop MapReduce jobs in Eclipse.
It is actually very easy to debug Hadoop MapReduce jobs in Eclipse, especially when you use maven.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment