1
我已經在Eclipse項目下面的代碼,當我導出到一個jar文件並運行Hadoop的節點上的Hadoop - UnsupportedOperationException異常:未經DistributedFileSystem
String hdrsUrl = "hdfs://servername:8020";
Configuration conf = new Configuration();
conf.set("fs.defaultFS", hdrsUrl);
FileSystem fs = FileSystem.get(conf);
我收到以下錯誤
實施15/04/17 08:21:43 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsupportedOperationException: Not implemented by the DistributedFileSystem FileSystem implementation
at org.apache.hadoop.fs.FileSystem.getScheme(FileSystem.java:216)
at org.apache.hadoop.fs.FileSystem.loadFileSystems(FileSystem.java:2564)
at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2574)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2591)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:91)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2630)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2612)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:370)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:169)
at com.express.BrierleyProcessor.App.main(App.java:33)
... 5 more
雖然,當我在節點上創建一個java文件,編譯它,設置類路徑,並執行它的工作沒有問題。
我錯過了什麼?
HDP 2.2.0對應的Hadoop 2.6.0。你能否澄清是什麼導致你使用hadoop 2.2版? – thinkmassive