很奇怪的问题,程序在eclipse上跑没问题;
这就代码:FileSystem fs = FileSystem.get(URI.create(hdfs_file), conf , "user");
在centos上跑就出错了
| PriviledgedActionException as: (auth:SIMPLE) cause:java.io.IOException: No FileSystem for scheme: hdfs
INFO | jvm 1 | 2013/12/25 15:35:54 | Error:Commit Worker Task:5: ProcessCommitLog()__java.io.IOException: No FileSystem for scheme: hdfs
然后就在网上搜之:http://www.cnblogs.com/fbiswt/p/3314439.html 得这位仁兄提点:
然后在程序添加如下配置,就好了
conf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
MyMainClass.logger.info(hdfs_file);