简体   繁体   English

Hadoop jar WordCount.jar WordCount /input /output 不起作用

[英]Hadoop jar WordCount.jar WordCount /input /output doesn't work

First we create input and output files manually with hdfs dfs -mkdir /input and hdfs dfs -mkdir /output .首先,我们使用hdfs dfs -mkdir /inputhdfs dfs -mkdir /output手动创建输入文件和 output 文件。 Then we execute hdfs dfs -copyFromLocal Books /Shakespare.txt /input/Shakespare.txt .然后我们执行hdfs dfs -copyFromLocal Books /Shakespare.txt /input/Shakespare.txt After we run hadoop jar WordCount.jar WordCount /input /output this code we get the following error:在我们运行hadoop jar WordCount.jar WordCount /input /output这段代码后,我们得到以下错误:

这个

Therefore we remove output and we run hadoop jar WordCount.jar WordCount /input /output again we get the following error:因此我们删除 output 并再次运行hadoop jar WordCount.jar WordCount /input /output我们得到以下错误:

这个

How can we get output?我们怎样才能得到output呢?

Edit after Majid Hajibaba's answer:在 Majid Hajibaba 的回答后编辑:这个

WordCount.jar will create output directory itself. WordCount.jar将创建 output 目录本身。 Just pass it as a parameter and don't make it handy.只是将它作为参数传递,不要让它方便。 So please remove output directory and try again.所以请删除 output 目录,然后重试。 However to run WordCount.jar you need to start yarn by start-yarn.sh and check ResourceManager is up and running by jps command.但是,要运行 WordCount.jar,您需要通过start-yarn.sh启动 yarn,并通过jps命令检查ResourceManager是否已启动并正在运行。

It is good to know default ports on Hadoop ecosystem.很高兴知道 Hadoop 生态系统上的默认端口。 See YARN Service Ports .请参阅YARN 服务端口

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

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