简体   繁体   English

使用jar命令执行WordCount程序时hadoop中的“无此文件或目录”

[英]“No such file or directory” in hadoop while executing WordCount program using jar command

I am new to Hadoop and am trying to execute the WordCount Problem. 我是Hadoop的新手,正在尝试执行WordCount问题。

Things I did so far - 我到目前为止所做的事情-

Setting up the Hadoop Single Node cluster referring the below link. 参考以下链接设置Hadoop单节点集群。 http://www.bogotobogo.com/Hadoop/BigData_hadoop_Install_on_ubuntu_single_node_cluster.php http://www.bogotobogo.com/Hadoop/BigData_hadoop_Install_on_ubuntu_single_node_cluster.php

Write the word count problem referring the below link https://kishorer.in/2014/10/22/running-a-wordcount-mapreduce-example-in-hadoop-2-4-1-single-node-cluster-in-ubuntu-14-04-64-bit/ 请参考以下链接写字数问题https://kishorer.in/2014/10/22/running-a-wordcount-mapreduce-example-in-hadoop-2-4-1-single-node-cluster-in -ubuntu-14-04-64位/

Problem is when I execute the last line to run the program - 问题是当我执行最后一行以运行程序时-

hadoop jar wordcount.jar /usr/local/hadoop/input /usr/local/hadoop/output hadoop jar wordcount.jar / usr / local / hadoop / input / usr / local / hadoop / output

Following is the error I get - 以下是我得到的错误- 在此处输入图片说明 The directory seems to be present 目录似乎存在 在此处输入图片说明 The file is also present in the directory with contents 该文件及其内容也存在于目录中 在此处输入图片说明

Finally, on a side note I also tried the following directory sturcture in the jar command. 最后,在旁注中,我还在jar命令中尝试了以下目录结构。 在此处输入图片说明

No avail! 徒劳无功! :/ :/

I would really appreciate if someone could guide me here! 如果有人可以在这里指导我,我将不胜感激!

Regards, Paul Alwin 问候,保罗·阿尔文

Your first image is using input from the local Hadoop installation directory, /usr 您的第一个映像使用的是本地Hadoop安装目录/ usr中的输入

If you want to use that data on your local filesystem, you can specify file:///usr/... 如果要在本地文件系统上使用该数据,则可以指定file:///usr/...

Otherwise, if you're running pseudo distributed mode, HDFS has been setup, and /usr does not exist in HDFS unless you explicitly created it there. 否则,如果您正在运行伪分布式模式,则已经设置了HDFS,并且/usr在HDFS中不存在,除非您在此处明确创建了它。

Based on the stacktrace, I believe the error comes from the /app/hadoop/ staging directory path not existing, or the permissions for it are not allowing your current user to run commands against that path 基于stacktrace,我认为错误是由于/app/hadoop/暂存目录路径不存在,或者它的权限不允许您当前的用户在该路径上运行命令

Suggestion: Hortonworks and Cloudera offer pre-built VirtualBox images and lots of tutorial resources. 建议:Hortonworks和Cloudera提供预构建的VirtualBox映像和大量教程资源。 Most companies will have Hadoop from one of those vendors, so it's better to get familiar with that rather than mess around with having to install Hadoop yourself from scratch, in my opinion 在我看来,大多数公司都会从其中一家供应商那里获得Hadoop,所以最好还是熟悉一下,而不是只从头开始自己安装Hadoop。

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

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