为什么hdfs不能从本地机器读取文件?这个异常中的路径似乎表明它正在从我的笔记本电脑(不是vm)读取,但它找不到文件。这个 ls
显示它确实存在(见底线)。请让我知道什么更多的信息,我可以提供!
java.io.FileNotFoundException: File file:/Users/rose/bigdata/4/data/data.txt does not exist
at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:468)
at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:380)
at org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSInputChecker.<init>(ChecksumFileSystem.java:139)
at org.apache.hadoop.fs.ChecksumFileSystem.open(ChecksumFileSystem.java:335)
at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:746)
at org.apache.hadoop.mapreduce.lib.input.LineRecordReader.initialize(LineRecordReader.java:83)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.initialize(MapTask.java:478)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:671)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:330)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.secur
14/02/03 16:05:27 WARN mapred.JobClient: Error reading task outputConnection refused
14/02/03 16:05:27 WARN mapred.JobClient: Error reading task outputConnection refused
ç∂ç^C~/bigdata/4/data ls
c1.txt c2.txt data.txt vocab.txt
1条答案
按热度按时间aemubtdh1#
我相信,除非您特别配置hadoop来忽略hdfs(
core-site.xml
:属性fs.defaultFS
设置为file:///
),然后它将从hdfs读取。将文件上载到hdfs(使用
hdfs dfs -put <file> <destination-on-hdfs>
或更改hadoop配置。您可能需要配置的不仅仅是fs.defaultFS
属性以使其正常工作。我希望这有帮助。:)