简体   繁体   English

为什么 HDFS FileNotFoundException:文件不存在?

[英]Why HDFS FileNotFoundException: File does not exist?

I visit HDFS from K8S pod, but it could not find the HDFS file.我从 K8S pod 访问 HDFS,但找不到 HDFS 文件。

Exception in thread "main" java.io.FileNotFoundException: File does not exist: hdfs://192.168.65.2:8020/user/flink/[/user/flink/.flink/job-1234/1624538371951/systemShipFiles/examples-wc.jar]
    at org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1309)
    at org.apache.hadoop.hdfs.DistributedFileSystem$22.doCall(DistributedFileSystem.java:1301)
    at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1317)
    at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:337)
    at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:289)
    at org.apache.hadoop.fs.FileSystem.copyToLocalFile(FileSystem.java:2030)
    at org.apache.hadoop.fs.FileSystem.copyToLocalFile(FileSystem.java:1999)
    at org.apache.hadoop.fs.FileSystem.copyToLocalFile(FileSystem.java:1975)
    at org.apache.flink.kubernetes.entrypoint.KubernetesInitContainerEntrypoint.fetchRemoteDependencies(KubernetesInitContainerEntrypoint.java:121)
    at org.apache.flink.kubernetes.entrypoint.KubernetesInitContainerEntrypoint.main(KubernetesInitContainerEntrypoint.java:72)
Error from server (BadRequest): container "flink-job-manager" in pod "job-1234-b8d68f956-c4g58" is waiting to start: PodInitializing

But I can got the file with the hadoop command as flows:但是我可以使用 hadoop 命令按流程获取文件:

hadoop fs -ls /user/flink/.flink/job-1234/1624538371951/systemShipFiles/oceanus-examples-wc.jar
21/06/24 20:43:45 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
-rw-r--r--   1 flink supergroup      13981 2021-06-24 20:39 /user/flink/.flink/job-1234/1624538371951/systemShipFiles/examples-wc.jar

The HADOOP is in local mode. HADOOP 处于本地模式。

Thanks for your help.谢谢你的帮助。

Can you try ls with full path that is prefixed with hdfs://192.168.65.2:8020/user/...... as it is as it appears in the stacktrace.您可以尝试使用以 hdfs://192.168.65.2:8020/user/...... 为前缀的完整路径,就像它在堆栈跟踪中显示的那样。

Check in the core-site.xml, the fs.defaultFs value is specified and correct.在core-site.xml中查看,fs.defaultFs的值是指定且正确的。

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

相关问题 FileNotFoundException但文件确实存在 - FileNotFoundException but file does exist FileNotFoundException:但是文件确实存在 - FileNotFoundException: But the file does exist java.io.FileNotFoundException:文件不存在:hdfs:// localhost:9000 / home / hduser / sqoop / lib / hsqldb-1.8.0.10.jar - java.io.FileNotFoundException: File does not exist: hdfs://localhost:9000/home/hduser/sqoop/lib/hsqldb-1.8.0.10.jar FileNotFoundException尽管文件存在 - FileNotFoundException although the file is exist java.io.FileNotFoundException-文件确实存在于目录中 - java.io.FileNotFoundException - file DOES exist in directory 即使我处理了异常并且文件确实存在,我仍然收到“ FileNotFoundException”。 - I keep getting “FileNotFoundException” even though I handled the exception and the file does exist. Hadoop:Reduce 阶段开始:FileNotFoundException 输出/file.out.index 不存在 - Hadoop: Start of Reduce phase: FileNotFoundException output/file.out.index does not exist 文件不存在? 线程“主”中的异常java.io.FileNotFoundException:-Java - File does not exist? Exception in thread “main” java.io.FileNotFoundException: - Java 为什么FileOutputStream抛出FileNotFoundException? - Why does FileOutputStream throw FileNotFoundException? 为什么现有文件不存在? - Why does existing file does not exist?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM