【问题标题】:Hadoop Jar FileSystemNotFoundExceptionHadoop Jar FileSystemNotFoundException
【发布时间】: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


    【解决方案1】:

    这个答案帮助了我:https://stackoverflow.com/a/14607953/7969573。看起来失败的节点在我的 CLASSPATH 中的 #HADOOP_HOME/share/hadoop/mapreduce/ 文件夹中具有我正在运行的类的 jar 副本。当我从应用程序调用的 shell 运行 jar 时,从节点中删除 jar 解决了这个问题。我本可以更新那个 jar,它也可以正常工作,但在我当前的工作流程架构下删除它更有意义。

    【讨论】:

      猜你喜欢
      • 2020-10-18
      • 2021-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多