hadoop异常: org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exi

在安装idea的hadoop开发环境的时候,环境安装完后,运行出现以下错误:


Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist:


这个提示了找不到文件,所以解决步骤如下:

1)确认下集群上的HDFS系统上有没有这个文件,没有的话用命令 hdfs dfs -mkdir -p XXXX 创建文件

2)用hdfs dfs -ls 确认下文件的存在,然后和自己输入的参数比较一下,看看有没有拼写错误

3)确认路径是否真的正确,因为hdfs上可能新建文件夹的时候无意识的都是用的相对路径,所以自己没

   确认正确的路径

比如自己认为的路径:hdfs://localhost:9000/input

实际上这个路径是错误的 输入 hdfs dfs -ls /

drwxr-xr-x   - root supergroup          0 2017-02-05 21:47 /user


发现实际上绝对路径应该是 hdfs://localhost:9000/user/hadoop/input




  • 4
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: 回答: 这个错误通常是由于输入路径不存在导致的。根据引用\[2\]的解释,当使用Eclipse运行MapReduce程序时,默认的参数是单机参数,而不是HDFS目录。因此,如果输入路径在HDFS中不存在,就会出现这个错误。解决这个问题的方法是在项目的src下加入core-site.xml和hdfs-site.xml两个文件,并将它们复制到WordCount项目的src文件夹中。这样,程序就能正确读取HDFS中的输入路径了。 #### 引用[.reference_title] - *1* *3* [Exception in thread "main" org.apache.hadoop.mapred.InvalidJobConfException: Output directory not se](https://blog.csdn.net/mtj66/article/details/52644800)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [错误Exception in threadmainorg.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input ...](https://blog.csdn.net/m0_60318777/article/details/121398932)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值