我正在运行一个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 get file from resources folder。然而,这些解决方案都无法解释为什么它只能在一个节点上工作而不能在另一个节点上工作。。。这一定意味着我在什么地方搞错了什么配置。
我已经检查了所有hadoopxmlconfig文件以及$classpath、$path和java运行时版本,一切看起来都是一样的。如果有人对我能查到的东西有任何其他想法,我将不胜感激-谢谢。
edit:澄清一下,它试图获取的文件是打包在jar中的资源。
1条答案
按热度按时间oxcyiej71#
这个答案帮助了我:https://stackoverflow.com/a/14607953/7969573. 看起来失败的节点有一个jar的副本,这个jar的类是我在类路径中的#hadoop_home/share/hadoop/mapreduce/文件夹中运行的。从节点中删除jar修复了从应用程序调用的shell运行jar时的问题。我本可以更新这个jar,它也可以工作,但是在我当前的工作流架构下删除它更有意义。