[英]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 /input
和hdfs 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.