Hadoop 将Mahout指向HDFS而不是本地磁盘

Hadoop 将Mahout指向HDFS而不是本地磁盘,hadoop,hdfs,mahout,Hadoop,Hdfs,Mahout,我正在尝试使用HDFS中的文件在Mahout上运行逻辑回归-文件名为ppeng.txt,并使用以下命令行 mahout org.apache.mahout.classifier.sgd.TrainLogistic——通过5 --速率1--lambda 0.5--input ppeng.txt--features 21--output test_mahout--target nbr_of_txns--categories 2--predictor 寿命期\版本\美元\金额ntpv \ 12个月\发

我正在尝试使用HDFS中的文件在Mahout上运行逻辑回归-文件名为ppeng.txt,并使用以下命令行

mahout org.apache.mahout.classifier.sgd.TrainLogistic——通过5 --速率1--lambda 0.5--input ppeng.txt--features 21--output test_mahout--target nbr_of_txns--categories 2--predictor 寿命期\版本\美元\金额ntpv \ 12个月\发送\美元\金额--类型n

该文件位于HDFS中,但是,除非我将该文件复制到本地计算机,否则此行会出错,并出现“未找到文件”异常

我的HADOOP_局部变量也设置为null。我得到的错误如下-有没有人有解决这个问题的经验-如果有,请帮助

Exception in thread "main" java.io.FileNotFoundException: ppeng.txt (No such file or directory)**
        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.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:188)
        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:197)
线程“main”java.io.FileNotFoundException:ppeng.txt中的异常(无此类文件或目录)** 在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.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68) 位于org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139) 位于org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:188) 在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:197)
它正在使用java.io.FileInputStream.open访问您的本地文件系统

你能跑吗

hadoop fs -ls
你是从哪里来的?如果是这样,您需要取消设置MAHOUT_LOCAL,然后重试。Mahout在您从中启动的机器上使用Hadoop设置来确定HDFS和mapreduce作业跟踪器的位置

这里有一篇关于在一台机器上在客户端、本地伪集群和完全集群成员之间切换的帖子。它还为管理员设置了正确的标志。只是一些bash函数