Java 路径名/c:/filename.txt自hdfs://localhost:5050/c:/filename.txt 不是有效的DFS文件名

Java 路径名/c:/filename.txt自hdfs://localhost:5050/c:/filename.txt 不是有效的DFS文件名,java,hadoop,Java,Hadoop,我在同一个hdfs文件系统中运行一个简单的wordcount程序并获得良好的输出。但我需要将输出文件放入本地系统,如:c:/filename.txt。但是在这样尝试的时候 conf.setInputFormat(TextInputFormat.class); conf.setOutputFormat(TextOutputFormat.class); FileInputFormat.setInputPaths(conf, new Path("Input"));

我在同一个hdfs文件系统中运行一个简单的wordcount程序并获得良好的输出。但我需要将输出文件放入本地系统,如:c:/filename.txt。但是在这样尝试的时候

conf.setInputFormat(TextInputFormat.class);

        conf.setOutputFormat(TextOutputFormat.class);

        FileInputFormat.setInputPaths(conf, new Path("Input"));

        FileOutputFormat.setOutputPath(conf, new Path("c:/filename.txt"));
我遇到以下错误:

14/03/03 23:04:32 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
java.lang.IllegalArgumentException: Pathname /c:/filename.txt from hdfs://localhost:5050/c:/filename.txt is not a valid DFS filename.
    at org.apache.hadoop.hdfs.DistributedFileSystem.getPathName(DistributedFileSystem.java:151)
    at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:411)
    at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:651)
    at org.apache.hadoop.mapred.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:110)
    at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:793)
    at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1142)
    at org.raj.MapReduceDriver.main(MapReduceDriver.java:52)

如果可以,请帮助我。

您不能从MapReduce程序将输出文件放在本地文件系统上。输出路径应设置为HDFS上的目录

您可以使用命令
hadoop-getmerge