from SRC to executable using eclipse
(http://ebiquity.umbc.edu/Tutorials/Hadoop/00%20-%20Intro.html)
1.install the plugin (from hadoop/contrib/ to eclipse/plugin)
2.configure DFS loc:
-NameNode: http://localhost:50070/
-JobTracker: http://localhost:50030/
??can't browsing DFS in eclipse
-Error: null in local_hadoop
-be aware that you need to spawn Eclipse from within Cygwin in order to access HDFS. It seems that the plugin uses "whoami" to get info about the active user.
3.create the helloworld project.
-specify the home loc of hadoop installation.
-create Driver class, and modify the outdated code to,
conf.setInputFormat(TextInputFormat.class);
conf.setOutputFormat(TextOutputFormat.class);
FileInputFormat.setInputPaths(conf, new Path("In"));
FileOutputFormat.setOutputPath(conf, new Path("Out"));
??can't run as (seems a bug of plugin-0.18.3 with Eclipse 3.3+: http://trac.nchc.org.tw/cloud/wiki/waue/Hadoop_Eclipse)
-download Eclipse 3.3(only works with 3.3, still problematic with 3.2...)
4.run a MR program in cmd
(http://hadoop.apache.org/core/docs/current/mapred_tutorial.html#Example%3A+WordCount+v1.0)
$ mkdir wordcount_classes
$ javac -classpath ${HADOOP_HOME}/hadoop-${HADOOP_VERSION}-core.jar -d wordcount_classes WordCount.java
$ jar -cvf /usr/joe/wordcount.jar -C wordcount_classes/ .
-upload files
$ bin/hadoop jar /usr/joe/wordcount.jar org.myorg.WordCount input output
PS:
Why eclipse with hadoop plugin must be spawned from cygwin.
-each process has a pool of environmental variables (PATH), presence of which implies enabling of certain executables (shell commends).
-eclipse process spawning from CYGWIN has same PATH as CYGWIN, so can use WHOISME cmd.
4.run a MR program in cmd
(http://hadoop.apache.org/core/docs/current/mapred_tutorial.html#Example%3A+WordCount+v1.0)
$ mkdir wordcount_classes
$ javac -classpath ${HADOOP_HOME}/hadoop-${HADOOP_VERSION}-core.jar -d wordcount_classes WordCount.java
$ jar -cvf /usr/joe/wordcount.jar -C wordcount_classes/ .
-upload files
$ bin/hadoop jar /usr/joe/wordcount.jar org.myorg.WordCount input output
PS:
Why eclipse with hadoop plugin must be spawned from cygwin.
-each process has a pool of environmental variables (PATH), presence of which implies enabling of certain executables (shell commends).
-eclipse process spawning from CYGWIN has same PATH as CYGWIN, so can use WHOISME cmd.
No comments:
Post a Comment