Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://node1:9000/input/pia
来源:互联网 发布:单簧管 笛头 知乎 编辑:程序博客网 时间:2024/06/10 13:25
在Windows本地开发时遇到这样的问题:
Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://node1:9000/input/piao.txt, expected: file:///
at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:643)
at org.apache.hadoop.fs.RawLocalFileSystem.pathToFile(RawLocalFileSystem.java:80)
at org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:519)
at org.apache.hadoop.fs.RawLocalFileSystem.getFileLinkStatusInternal(RawLocalFileSystem.java:737)
at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:514)
at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:397)
at org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSInputChecker.<init>(ChecksumFileSystem.java:140)
at org.apache.hadoop.fs.ChecksumFileSystem.open(ChecksumFileSystem.java:341)
at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:764)
at com.ibeifeng.hadoop.senior.hdfs.HdfsApp.main(HdfsApp.java:36)
部分代码:
String fileName = "hdfs://node1:9000/input/piao.txt";
Path readPath = new Path(fileName);
fileSystem.open(readPath);
FSDataInputStream inputStream = fileSystem.open(readPath);
问题的解决:
1,首先检查访问服务器的路径是否正确:hdfs://node1:9000/input/piao.txt。
2,因为本地连接服务器开发,本地的Eclipse中需要服务器中的两个配置文件:core-site.xml 和hdfs.site.xml
但是修改完了,再次运行,结果还是报错:
Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://node1:9000/input/piao.txt, expected: hdfs://node1:8020
at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:643)
at org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:184)
at org.apache.hadoop.hdfs.DistributedFileSystem.access$000(DistributedFileSystem.java:101)
at org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:293)
at org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:289)
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at org.apache.hadoop.hdfs.DistributedFileSystem.open(DistributedFileSystem.java:289)
at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:764)
at com.ibeifeng.hadoop.senior.hdfs.HdfsApp.main(HdfsApp.java:35)
这里的端口需要将9000 改成8020 ,即:hdfs://node1:8020/input/piao.txt
于是就可以愉快的跑起来了。
- Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://node1:9000/input/pia
- Exception in thread “main” java.lang.IllegalArgumentException: Wrong FS: hdfs://localhost:9000/user/
- Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://localhost:9000/user/
- hException in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://hadoop:9000/tadoop:
- Exception in thread "main" java.lang.IllegalArgumentException
- Exception in thread "main" java.lang.IllegalArgumentException: input == null!
- Exception in thread "main" java.lang.IllegalArgumentException: input == null!
- HDFS API文件上传报错 Exception in thread "main" .......: Wrong FS: file:///
- exception in thread main java.lang.noclassdeffounderror wrong name
- exception in thread main java.lang.NoClassDefFoundError wrong name解决方法
- exception in thread main java.lang.noclassdeffounderror wrong name
- exception in thread main java.lang.NoClassDefFoundError wrong name解决方法
- hadoop fs -put Exception in thread "main" java.lang.UnsatisfiedLink
- Exception in thread "main" java.lang.illegalArgumentException : illegal component position
- java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///
- Hadoop 问题java.lang.IllegalArgumentException Wrong FS: hdfs://192.168
- Hbase java.lang.IllegalArgumentException: Wrong FS file://......expected:hdfs://...
- Caused by: java.lang.IllegalArgumentException: Wrong FS: hdfs:// :9000/ expected: hdfs:// :9000
- centos下svn安装,svn用户管理,svn用户目录管理(虚拟机下访问)
- 实战tcpdump看RST
- 前端安全问题初探
- STL之list容器详解
- BZOJ3065: 带插入区间K小值(替罪羊树+权值线段树)
- Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://node1:9000/input/pia
- 机房重构
- stl之map的用法详解
- (转)金融信息服务业的国际国内竞争格局及新动向
- mysql innodb读书笔记
- http权威指南 读书笔记
- redis 读书笔记
- 关于禁止html缓存
- 数的平方和拆分