Mahout:Error: java.lang.ClassNotFoundException: org.apache.mahout.math.Vector

”WARN driver.MahoutDriver: No org.apache.mahout.clustering.syntheticcontrol.canopy.Job.props found on classpath, will use command-line arguments only“

MAHOUT_CONF_DIR=$MAHOUT_HOME/src/conf

MAHOUT_CONF_DIR=$MAHOUT_HOME/conf


Error: java.lang.ClassNotFoundException: org.apache.mahout.math.Vector:

/opt/hadoop-0.20.2/bin/hadoop jar /opt/mahout-distribution-0.5/mahout-examples-0.5-job.jar org.apache.mahout.driver.MahoutDriver org.apache.mahout.clustering.syntheticcontrol.canopy.Job

mahout脚本:

if [ $IS_CORE == 0 ]

then

  # add release dependencies to CLASSPATH

  for f in $MAHOUT_HOME/mahout-*.jar; do

    CLASSPATH=${CLASSPATH}:$f;

  done

意思是将mahout-distribution-0.5目录下的所有jar放到CLASSPATH中,然而碰巧mahout-core-0.5.jar排在mahout-examples-0.5-job.jar前面,并且包含类org.apache.mahout.driver.MahoutDriver,因此实际上提交给Hadoop的是mahout-core-0.5.jar,而不是后者。mahout-core-0.5.jar没有Vector类,因此运行时报错。

解决:root@master:/opt/mahout-distribution-0.5# bin/mahout -core  org.apache.mahout.clustering.syntheticcontrol.canopy.Job

你可能感兴趣的:(mahout Vector)