很奇怪的问题,程序在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);

相关文章:

  • 2021-08-01
  • 2021-09-05
  • 2021-09-13
  • 2022-03-02
  • 2021-10-27
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2021-12-08
  • 2021-07-25
  • 2021-05-08
相关资源
相似解决方案