Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/D:/input/hello.txt
时间: 2024-05-17 17:19:26 浏览: 17
这个错误是因为 Hadoop 找不到输入路径 `/D:/input/hello.txt`。你需要确认输入路径是否正确,以及文件是否存在。如果输入路径正确,但文件不存在,那么你需要创建这个文件,或者修改输入路径,使其指向已经存在的文件。如果你使用的是 HDFS,那么输入路径应该以 `hdfs://` 开头,例如 `hdfs://localhost:9000/input/hello.txt`。
相关问题
Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException:
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 thread “main“ org.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 ]
org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/home/hadoop/test.txt
这个错误提示是说你的输入路径不存在,可能是由于以下原因之一:
1. 路径错误:请检查你的输入路径是否正确,并确保在 HDFS 上或本地文件系统上存在该路径。
2. 权限问题:请检查你是否有足够的权限读取该路径。如果路径在 HDFS 上,请检查你是否有 HDFS 文件系统的读取权限。
3. 文件不存在:如果路径是正确的并且你有足够的权限,但仍然收到该错误,则可能是因为输入文件不存在。
请检查这些原因,找到问题所在,并尝试解决它。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)