Hadoop Jar FileSystemNotFoundException

Hadoop Jar FileSystemNotFoundException

我正在 运行 构建一个 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[=10=]0(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)

我看到其他人也有类似的问题,例如这个问题及其解决方案以及其他问题和解决方案的链接:。但是,这些解决方案中的 none 可以解释为什么它可以在一个节点而不是另一个节点上工作......这一定意味着我在某处有一些配置错误。

我检查了所有 hadoop xml 配置文件以及 $CLASSPATH、$PATH 和 java 运行time 版本,一切似乎都是一样的。如果有人对我可以检查的内容有任何其他想法,将不胜感激 - 谢谢。

编辑:澄清一下,它试图获取的文件是打包在 JAR 中的资源。

这个答案帮助了我:。看起来失败的节点有一个带有 class 的 jar 副本,我在我的 CLASSPATH 中的 #HADOOP_HOME/share/hadoop/mapreduce/ 文件夹中 运行ning。从节点中删除 jar 解决了这个问题,因为我 运行 来自我的应用程序调用的 shell 的 jar。我本可以只更新那个 jar,它也能正常工作,但在我当前的工作流架构下删除它更有意义。