使用Hadoop FileNotFoundError运行Mahout

使用Hadoop FileNotFoundError运行Mahout,hadoop,mahout,Hadoop,Mahout,我正在尝试使用。\bin\hadoop jar path\u to\u Mahout\u jar等运行Mahout 它仅在输入为本地文件时工作。当我尝试使用Hadoop文件系统中的文件时,会出现以下错误: Exception in thread "main" java.io.FileNotFoundException: input (The system cannot find the file specified) at java.io.FileInputStream.open

我正在尝试使用。\bin\hadoop jar path\u to\u Mahout\u jar等运行Mahout

它仅在输入为本地文件时工作。当我尝试使用Hadoop文件系统中的文件时,会出现以下错误:

Exception in thread "main" java.io.FileNotFoundException: input (The system cannot find the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:120)
        at org.apache.mahout.classifier.sgd.TrainLogistic.open(TrainLogistic.java:316)
        at org.apache.mahout.classifier.sgd.TrainLogistic.mainToOutput(TrainLogistic.java:75)
        at org.apache.mahout.classifier.sgd.TrainLogistic.main(TrainLogistic.java:64)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
线程“main”java.io.FileNotFoundException:input中的异常(系统找不到指定的文件) 在java.io.FileInputStream.open(本机方法) 位于java.io.FileInputStream。(FileInputStream.java:120) 位于org.apache.mahout.classifier.sgd.TrainLogistic.open(TrainLogistic.java:316) 位于org.apache.mahout.classifier.sgd.TrainLogistic.mainToOutput(TrainLogistic.java:75) 位于org.apache.mahout.classifier.sgd.TrainLogistic.main(TrainLogistic.java:64) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处 位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)中 位于java.lang.reflect.Method.invoke(Method.java:597) 位于org.apache.hadoop.util.RunJar.main(RunJar.java:156)
但是,当我查看HDFS时,我可以看到该文件。

这很奇怪,对我来说,mahout在HDFS的控制器中查找文件,为了在本地文件系统中创建mahout,我必须提供一个文件:///URI。 可能您应该尝试Sean为您的问题建议的hdfs://URI。

Trainlogistic算法(以及其他一些分类算法)不能在hdfs上运行

检查这个,它说它只能在一台机器上运行


祝你好运

如果在本地工作,可以使用java.io,但如果在HDFS上工作,则必须使用hadoop.io操作。也许以下链接可以帮助您:


您如何指定输入?它没有显示。尝试指定的
hdfs://
URIIhdfs://54.186.225.72/data 但它仍然不起作用,将错误hdfs:/54.186.225.72/数据用“hdfs:/”而不是“hdfs:/”抛出