【发布时间】:2020-12-19 21:53:16
【问题描述】:
我正在运行一个 hadoop 集群并尝试使用我发送到集群的 jar 文件来运行 mapreduce 作业。问题是在某些节点上它成功而在其他节点上失败。我在某些节点上看到的错误是:
Exception in thread "main" java.nio.file.FileSystemNotFoundException
at com.sun.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:183)
at com.sun.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:169)
at java.nio.file.Paths.get(Paths.java:154)
at customLib.readFile(CustomClass2.java:254)
at customLib.access$000(CustomClass2.java:210)
at customLib.getFieldOrder(CustomClass2.java:591)
at customLib.run(CustomClass1.java:177)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90)
at customLib.main(CustomClass1.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
我看到其他人也遇到过类似的问题,例如这个问题的解决方案以及其他问题和解决方案的链接:java.nio.file.FileSystemNotFoundException when getting file from resources folder。但是,这些解决方案都无法解释为什么它可以在一个节点上运行,而不是在另一个节点上运行......这一定意味着我在某处有一些配置错误。
我检查了所有 hadoop xml 配置文件以及 $CLASSPATH、$PATH 和 java 运行时版本,一切似乎都一样。如果有人对我可以检查的内容有任何其他想法,将不胜感激 - 谢谢。
编辑:澄清一下,它试图获取的文件是打包在 JAR 中的资源。
【问题讨论】:
标签: java hadoop jar mapreduce nio