Mahout:输出文件在 Hadoop 中给出错误
Mahout : output file giving error in Hadoop
我在 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
如何解决这个问题?
驯象师版本:0.11.0
我遇到了同样的问题。找到解决方案。
如果输出文件目录或 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
我在 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
如何解决这个问题?
驯象师版本:0.11.0
我遇到了同样的问题。找到解决方案。
如果输出文件目录或 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