简体   繁体   English

使用命令行在Windows的hadoop上运行wordcount.jar

[英]Running wordcount.jar on hadoop in windows using command line

I am trying to run a simple wordcount program on hadoop, but facing an error as below. 我正在尝试在hadoop上运行一个简单的wordcount程序,但是遇到如下错误。

 Exception in thread "main" java.io.IOException: Error opening job jar: /user/asiapac/bmohanty6/wordcount/wordcount.jar
        at org.apache.hadoop.util.RunJar.main(RunJar.java:90)
Caused by: java.io.FileNotFoundException: \user\asiapac\bmohanty6\wordcount\wordcount.jar (The system cannot find the path specified)
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.<init>(Unknown Source)
 at java.util.zip.ZipFile.<init>(Unknown Source)
 at java.util.jar.JarFile.<init>(Unknown Source)
 at java.util.jar.JarFile.<init>(Unknown Source)
 at org.apache.hadoop.util.RunJar.main(RunJar.java:88)


I am using below command. 我正在使用以下命令。

$ bin/hadoop jar /user/asiapac/bmohanty6/wordcount/wordcount.jar WordCount /user/asiapac/bmohanty6/wo
rdcount/input /user/asiapac/bmohanty6/wordcount/output

I am using Cygwin, hadoop-0.20.2 with pseudo node set up. 我正在使用带有伪节点设置的Cygwin,hadoop-0.20.2。 I have also uploaded the wordcount.jar to my DFS. 我也已将wordcount.jar上传到我的DFS。 See below my DFS screenshot 请参阅下面的DFS屏幕截图

在此处输入图片说明

I am able to run the same wordcount program in eclipse successfully. 我能够在Eclipse中成功运行相同的wordcount程序。 I have created the wordcount.jar file via eclipse as per this tutorial. 我已经按照教程通过eclipse创建了wordcount.jar文件。 I searched a lot in web but could not understand how to solve this. 我在网上搜索了很多内容,但不知道如何解决。 Please help me. 请帮我。

You need to add / before user : 您需要在user之前添加/

bin/hadoop jar /user/asiapac/bmohanty6/wordcount/wordcount.jar WordCount /user/asiapac/bmohanty6/wordcount/input /user/asiapac/bmohanty6/wordcount/output

This makes them fully-qualified paths. 这使它们成为完全合格的路径。 If you omit / before user , Hadoop will search from the current directory. 如果在user之前省略/ ,则Hadoop将从当前目录搜索。

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

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