You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows10单节点Hadoop本地文件复制报错:No such file or directory

Fixing "No such file or directory" Error with Hadoop copyFromLocal on Windows 10

Hey there, let's work through this HDFS file copy issue together—I've dealt with similar quirks running Hadoop on Windows before, so here's a breakdown of the most likely fixes:

1. Verify Your Local File Path & Current Working Directory

First off, relative paths like ../my_models/*.model can be tricky in Windows' command line. Let's confirm the basics:

  • Open your cmd/PowerShell and run cd (cmd) or Get-Location (PowerShell) to check your current working directory. Calculate if ../my_models actually points to the right folder. For example, if you're in C:\hadoop\bin, ../my_models would be C:\hadoop\my_models—double-check this folder exists and contains your .model files.
  • Test if the wildcard works locally first: run dir ../my_models/*.model (cmd) or Get-ChildItem ../my_models/*.model (PowerShell). If this returns "file not found", either the path is wrong, or Windows isn't expanding the * wildcard correctly for Hadoop.

2. Switch to Absolute Paths

Relative paths are prone to confusion—replace them with full absolute paths to eliminate ambiguity. For example:

hadoop fs -copyFromLocal C:\full\path\to\my_models\*.model hdfs://localhost/tmp

If that still fails, test with a single file first to rule out wildcard issues:

hadoop fs -copyFromLocal C:\full\path\to\my_models\aaa.model hdfs://localhost/tmp

3. Check HDFS Target Path Exists

While your error points to local files, it's worth confirming the HDFS target isn't the problem. Run this to check if /tmp exists:

hadoop fs -ls hdfs://localhost/tmp

If it doesn't exist, create it first:

hadoop fs -mkdir -p hdfs://localhost/tmp

4. Fix Windows Permissions

Windows' user permissions can block Hadoop from accessing local files. Try these steps:

  • Right-click your command prompt/PowerShell and select Run as administrator, then re-execute the copy command.
  • Ensure your current user has read permissions for the my_models folder and all .model files inside it.

5. Work Around Windows Wildcard Limitations

Windows CMD doesn't expand wildcards like Linux shells do, which can cause Hadoop to receive the literal *.model string instead of the actual file list. Try these alternatives:

  • Use PowerShell instead of CMD—it handles wildcards properly and will expand *.model to the actual file names before passing them to Hadoop.
  • Manually list all files in the command:
hadoop fs -copyFromLocal ../my_models/aaa.model ../my_models/bbb.model hdfs://localhost/tmp

内容的提问来源于stack exchange,提问作者Dims

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:53:37