Hadoop - MapReduce eclipse plugin not pointing to hdfs


MapReduce Eclipse plugin not pointing to local file system rather hdfs.


On your first run of WordCount from eclipse -> run on hadoop you may notice the java program uses local file system instead hdfs.

Adding hdfs location in your Configuration object solves this issue. In case of WordCount.java add the below into your main method.


public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();

conf.addResource(new Path(HADOOP_INSTALL+"/conf/core-site.xml"));
conf.addResource(new Path(HADOOP_INSTALL+"/conf/hdfs-site.xml"));

}

Comments

  1. Excellent article, highly enlightening. For more information, visit this link:
    Digital Marketing Company in Chennai

    ReplyDelete

Post a Comment

Popular posts from this blog

Log4j multiple WAR files in single EAR configuration

Ubuntu / kubuntu - Laptop key board cursor jumping issue

Java NIO2 - Watching a directory for changes. FileWatcherService.