【问题标题】:Point Mahout to HDFS instead of local disk将 Mahout 指向 HDFS 而不是本地磁盘
【发布时间】:2014-08-10 12:05:15
【问题描述】:

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

mahout org.apache.mahout.classifier.sgd.TrainLogistic --passes 5 --rate 1 --lambda 0.5 --input peng.txt --features 21 --output test_mahout --target nbr_of_txns --categories 2 --predictors life_rev_usd_amt ntpv_12_mth_sent_usd_amt --types n n

此文件位于 HDFS 中,但是,除非我将文件复制到本地计算机,否则此行会出错并出现 File Not Found 异常。

我的 HADOOP_LOCAL 变量也设置为 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)

【问题讨论】:

    标签: hadoop hdfs mahout


    【解决方案1】:

    它正在使用 java.io.FileInputStream.open 访问您的本地文件系统。

    你能跑吗

    hadoop fs -ls
    

    从哪里运行 Mahout 作业?如果是这样,您需要取消设置 MAHOUT_LOCAL 并重试。 Mahout 使用您要启动的机器上的 Hadoop 设置来确定 HDFS 和 mapreduce 作业跟踪器的位置。

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

    http://occamsmachete.com/ml/2012/07/02/how-to-switch-hadoop-confugurations/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-27
      • 2019-04-18
      相关资源
      最近更新 更多