简体   繁体   English

如何在Hadoop环境中执行用Java编写的Hadoop Job

[英]How to execute Hadoop Job written in Java on Hadoop Environment

I have class files loaded on to Hadoop file system.And also i have loaded input file to hdfs. 我已经将类文件加载到Hadoop文件系统上,也已经将输入文件加载到hdfs中。 When I run class file through hadoop command in terminal i get Class not found error. 当我在终端中通过hadoop命令运行类文件时,出现类未找到错误。 EG: I have HDFS contents as WordCount.class WordCountMapper.class WordCOuntReducer.class SampleInpujt.txt EG:我的HDFS内容为WordCount.class WordCountMapper.class WordCOuntReducer.class SampleInpujt.txt

Can Some one correct me where i am doing wrong.Or is this can be done in real. 有人可以纠正我做错的地方吗?还是可以真正做到这一点。

Below is the commandline we use for running a Java mapreduce job on our 4-node Hadoop-2.2.0 cluster daily and it works fine. 下面是我们用于每天在4节点Hadoop-2.2.0集群上运行Java mapreduce作业的命令行,它运行良好。 We run it from the namenode but any machine in the cluster should work fine. 我们从namenode运行它,但是集群中的任何计算机都可以正常工作。

hadoop jar ~/..path../mr_orchestrate/target/mr-orchestrate-1.0.jar com.rr.ap.orchestrate.MROrchestrate /user/hduser/in/Sample_15Feb2014.txt /user/hduser/out/out15Feb2014 

You may need the "-libjars" option to add other library paths. 您可能需要“ -libjars”选项来添加其他库路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM