2015-11-05 19 views
0

在Hadoop上運行Mahout時出現以下錯誤。Mahout:輸出文件在Hadoop中發生錯誤

命令:

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

+0

就像消息說的那樣,您需要先從HDFS中刪除目錄,然後運行該腳本。 – Ambrish

回答

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