Wrong FS: hdfs://xxx/xxx expected: file:///
生活随笔
收集整理的這篇文章主要介紹了
Wrong FS: hdfs://xxx/xxx expected: file:///
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Eclipse調(diào)用HDFS API上傳文件時(shí)出現(xiàn)了如下錯(cuò)誤:
Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://master:9000/user/Administrator, expected: file:///at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:659)at org.apache.hadoop.fs.RawLocalFileSystem.pathToFile(RawLocalFileSystem.java:82)at org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:585)at org.apache.hadoop.fs.RawLocalFileSystem.getFileLinkStatusInternal(RawLocalFileSystem.java:803)at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:580)at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:425)at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1414)at org.apache.hadoop.fs.FileUtil.checkDest(FileUtil.java:499)at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:351)at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:341)at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:292)at org.apache.hadoop.fs.LocalFileSystem.copyFromLocalFile(LocalFileSystem.java:82)at org.apache.hadoop.fs.FileSystem.copyFromLocalFile(FileSystem.java:1884)at com.hellohadoop.FileOperator.Upload(FileOperator.java:48)at com.hellohadoop.FileOperator.main(FileOperator.java:23)解決的辦法是把Hadoop集群的hdfs-site.xml和core-site.xml兩個(gè)配置文件復(fù)制到項(xiàng)目的bin目錄下面,就可以正常運(yùn)行了。
轉(zhuǎn)載于:https://www.cnblogs.com/mstk/p/6682130.html
總結(jié)
以上是生活随笔為你收集整理的Wrong FS: hdfs://xxx/xxx expected: file:///的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Codeforces 724 G Xor
- 下一篇: 网页前端优化