mahout seqdirectory无法读取输入文件

时间:2014-03-31 15:17:45

标签: mapreduce mahout

我用seqdirectory运行了Mahout,但它失败了,并说输入文件不存在。确实文件退出了。

$ ls train-data/ -l
-rwxrwxrwx. 1 hadoop hadoop 5761396717 Feb 25 09:28 enwiki-20100904-pages-articles1.xml



$ mahout seqdirectory -i train-data/enwiki-20100904-pages-articles1.xml -o train-data
Running on hadoop, using /home/hadoop/hadoop-1.2.1/bin/hadoop and HADOOP_CONF_DIR=
MAHOUT-JOB: /home/hadoop/mahout-distribution-0.9/examples/target/mahout-examples-0.9-job.jar
14/03/31 19:45:05 INFO common.AbstractJob: Command line arguments: {--charset=[UTF-8], --chunkSize=[64], --endPhase=[2147483647], --fileFilterClass=[org.apache.mahout.text.PrefixAdditionFilter], --input=[train-data/enwiki-20100904-pages-articles1.xml], --keyPrefix=[], --method=[mapreduce], --output=[train-data], --startPhase=[0], --tempDir=[temp]}
Exception in thread "main" java.io.FileNotFoundException: File does not exist: train-data/enwiki-20100904-pages-articles1.xml
    at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:558)
    at org.apache.mahout.text.SequenceFilesFromDirectory.runMapReduce(SequenceFilesFromDirectory.java)
    at org.apache.mahout.text.SequenceFilesFromDirectory.run(SequenceFilesFromDirectory.java)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
    at org.apache.mahout.text.SequenceFilesFromDirectory.main(SequenceFilesFromDirectory.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
    at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
    at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:160)

有什么问题?

1 个答案:

答案 0 :(得分:2)

您所指的FileSystem是本地文件系统,但操作是期待HDFS中的文件。因此,要么在HDFS中移动文件,要么设置MAHOUT LOCAL变量。

相关问题