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

使用Hadoop put命令上传文件时提示“No such file or directory”错误求助

HDFS上传文件报错“No such file or directory”排查方案

你的hdfs dfs -put /home/srikanthamsa/hello.txt /命令语法本身没问题,报错大概率是以下几个原因,逐个排查:

  • 先确认本地文件真实存在:执行ls /home/srikanthamsa/hello.txt,检查路径里的用户名、文件名有没有拼写错误,Linux系统大小写敏感,别把Hello.txt写成hello.txt。
  • 检查HDFS根目录权限:普通用户默认没有HDFS根目录/的写入权限,试试上传到自己的用户目录,比如先执行hdfs dfs -mkdir -p /user/srikanthamsa创建目录,再用hdfs dfs -put /home/srikanthamsa/hello.txt /user/srikanthamsa/上传。
  • 验证Hadoop服务状态:用jps命令查看进程列表,确认NameNode、DataNode、ResourceManager这些核心进程都在运行,要是有进程没启动,先重启对应服务。
  • 测试HDFS根目录可访问性:执行hdfs dfs -ls /,如果这个命令也报错,说明HDFS集群连接有问题,检查core-site.xml里的fs.defaultFS配置是否正确。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.24 19:24:20