我已经在伪分布式模式下配置了hadoop。我已经成功地创建了序列文件和tf-idf向量(使用seq2sparse),并尝试从命令行运行mahout kmeans,如下所示:
mahout kmeans-i/user/mahout/vectors/tfidf vectors-c/user/mahout/cluster centroids-o/user/mahout/kmeans-dm org.apache.mahout.commom.distance.cosinedistancemeasure-x 10-k 20-ow--clustering-cl
我得到以下错误:
Running on hadoop, using /usr/local/hadoop/bin/hadoop and HADOOP_CONF_DIR=
MAHOUT-JOB: /home/mahout/apache-mahout-distribution-0.10.1/mahout-examples-0.10.1-job.jar
15/07/01 11:14:15 INFO AbstractJob: Command line arguments: {--clustering=null, --clusters=[/user/mahout/cluster-centroids], --convergenceDelta=[0.5], --distanceMeasure=[org.apache.mahout.commom.distance.CosineDistanceMeasure], --endPhase=[2147483647], --input=[/user/mahout/vectors/tfidf-vectors], --maxIter=[10], --method=[mapreduce], --numClusters=[20], --output=[/user/mahout/kmeans], --overwrite=null, --startPhase=[0], --tempDir=[temp]}
15/07/01 11:14:16 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Exception in thread "main" java.lang.IllegalStateException: java.lang.ClassNotFoundException: org.apache.mahout.commom.distance.CosineDistanceMeasure
at org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:30)
at org.apache.mahout.clustering.kmeans.KMeansDriver.run(KMeansDriver.java:91)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.mahout.clustering.kmeans.KMeansDriver.main(KMeansDriver.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:71)
at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144)
at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:152)
at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:195)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.ClassNotFoundException: org.apache.mahout.commom.distance.CosineDistanceMeasure
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at org.apache.mahout.common.ClassUtils.instantiateAs(ClassUtils.java:28)
... 17 more
我试过设置 HADOOP_CLASSPATH
到所需的jar文件。
暂无答案!
目前还没有任何答案,快来回答吧!