【问题标题】:Mahout : output file giving error in HadoopMahout:输出文件在 Hadoop 中给出错误
【发布时间】:2016-10-04 17:56:13
【问题描述】:

在 Hadoop 上运行 Mahout 时出现以下错误。

命令:

 mahout recommenditembased -s SIMILARITY_LOGLIKELIHOOD -i /user/inp -o /user/op --numRecommendations 5

错误:

Running on hadoop, using /usr/local/hadoop/bin/hadoop and HADOOP_CONF_DIR=
MAHOUT-JOB: /opt/apache-mahout-distribution- 0.11.0/examples/target/mahout-examples-0.11.0-job.jar
15/11/05 17:52:29 INFO AbstractJob: Command line arguments: {--booleanData=[false], --endPhase=[2147483647], --input=[/user/inp], --maxPrefsInItemSimilarity=[500], --maxPrefsPerUser=[10], --maxSimilaritiesPerItem=[100], --minPrefsPerUser=[1], --numRecommendations=[5], --output=[/user/], --similarityClassname=[SIMILARITY_LOGLIKELIHOOD], --startPhase=[0], --tempDir=[temp]}
15/11/05 17:52:29 INFO AbstractJob: Command line arguments: {--booleanData=[false], --endPhase=[2147483647], --input=[/user/inp], --minPrefsPerUser=[1], --output=[temp/preparePreferenceMatrix], --ratingShift=[0.0], --startPhase=[0], --tempDir=[temp]}
15/11/05 17:52:30 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
15/11/05 17:52:30 INFO deprecation: mapred.input.dir is deprecated. Instead, use mapreduce.input.fileinputformat.inputdir
15/11/05 17:52:30 INFO deprecation: mapred.compress.map.output is deprecated. Instead, use mapreduce.map.output.compress
15/11/05 17:52:30 INFO deprecation: mapred.output.dir is deprecated. Instead, use mapreduce.output.fileoutputformat.outputdir
15/11/05 17:52:30 INFO deprecation: session.id is deprecated. Instead, use dfs.metrics.session-id
15/11/05 17:52:30 INFO JvmMetrics: Initializing JVM Metrics with processName=JobTracker, sessionId=
Exception in thread "main" org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory temp/preparePreferenceMatrix/itemIDIndex already exists

但我找不到任何已创建的输出文件夹:

hadoop fs -ls /
15/11/05 17:55:40 WARN util.NativeCodeLoader: Unable to load native- hadoop library for your platform... using builtin-java classes where applicable
Found 1 items
drwxr-xr-x   - hduser supergroup          0 2015-11-05 17:47 /user

如何解决?

Mahout 版本:0.11.0

【问题讨论】:

  • 如消息所述,您需要先从 HDFS 中删除目录,然后运行脚本。

标签: hadoop mahout


【解决方案1】:

我遇到了同样的问题。找到了解决方案。

如果输出文件目录或 tempDir 已经存在,Mahout 会出错。所以先删除再执行命令。还可以使用自定义 --tempDir 选项并设置临时目录以生成输出。否则它将在您执行命令的位置生成temp 文件夹。如果您不想自定义 tempDir,请在执行命令之前删除 temp/ 目录。

rm -rf /user/op /tmp/mahout/ && mahout recommenditembased -s SIMILARITY_LOGLIKELIHOOD -i /user/inp -o /user/op --tempDir /tmp/mahout/ --numRecommendations 5

【讨论】:

  • 我找不到创建temp/ 目录的位置。我选择了--tempDir 标志解决方案,这对我有用。谢谢!
猜你喜欢
  • 1970-01-01
  • 2012-05-18
  • 1970-01-01
  • 1970-01-01
  • 2013-11-25
  • 2011-01-27
  • 2013-10-01
  • 2016-06-10
  • 2012-06-06
相关资源
最近更新 更多