当前位置: 代码迷 >> 综合 >> No FileSystem for scheme: C
  详细解决方案

No FileSystem for scheme: C

热度:25   发布时间:2023-10-19 11:11:37.0

在写mapJoin添加缓存文件时出现如下异常:

Exception in thread "main" java.io.IOException: No FileSystem for scheme: Cat org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2644)at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2651)at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:92)at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2687)at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2669)at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:371)at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.getFileStatus(ClientDistributedCacheManager.java:223)at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.determineTimestamps(ClientDistributedCacheManager.java:93)at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.determineTimestampsAndCacheVisibilities(ClientDistributedCacheManager.java:57)at org.apache.hadoop.mapreduce.JobResourceUploader.uploadFiles(JobResourceUploader.java:179)at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:95)at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:190)at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290)at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287)at java.security.AccessController.doPrivileged(Native Method)at javax.security.auth.Subject.doAs(Subject.java:422)at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)at org.apache.hadoop.mapreduce.Job.submit(Job.java:1287)at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1308)at mr.day06.MapJoinT.MapJoinDriver.main(MapJoinDriver.java:39)

提取关键信息后查看Driver有如下一行代码:

//5 addCacheFile 
job.addCacheFile (new URI("C:/Users/Administrator/Desktop/tmp/mr/inputRjoin/pd.txt"));

URI写错了,细心点,这里的URI和Path的写法不一样的;修改后如下:

//5 addCacheFile 
job.addCacheFile (new URI("file:///C:/Users/Administrator/Desktop/tmp/mr/inputRjoin/pd.txt"));

No FileSystem for scheme: C

  相关解决方案