标签:
1 下载
在http://archive.apache.org/dist/mahout 下载相应版本的mahout 版本,获取官网查看http://mahout.apache.org 相关的信息
下载后解压,
tar -zxvf mahout-distribution-0.9.tar.gz
配置环境变量
export MAHOUT_HOME=/home/sms/mahout-distribution-0.9 export MAHOUT_CONF_DIR=$MAHOUT_HOME/conf export PATH=$MAHOUT_HOME/bin:$PATH export CLASSPATH=$CLASSPATH:$MAHOUT_HOME/lib:$MAHOUT_HOME/lib/hadoop/hadoop-core-1.2.1.jar export MAHOUT_LOCAL=
2 启动hadoop运行测试
下载测试数据 http://archive.ics.uci.edu/ml/databases/synthetic_control/synthetic_control.data 创建测试目录 testdata,并把数据导入到这个tastdata目录中(这里的目录的名字只能是testdata) hadoop fs -mkdir testdata hadoop fs -put synthetic_control.data testdata 命令测试 hadoop jar /home/sms/mahout-distribution-0.9/mahout-examples-0.9-job.jar org.apache.mahout.clustering.syntheticcontrol.kmeans.Job 命令查看 hadoop fs -ls output
3 问题汇集
[sms@gc64 ~]$ mahout MAHOUT_LOCAL is not set; adding HADOOP_CONF_DIR to classpath. Running on hadoop, using HADOOP_HOME=/home/sms/hadoop HADOOP_CONF_DIR=/home/sms/hadoop/etc/hadoop MAHOUT-JOB: /home/sms/mahout-distribution-0.6/mahout-examples-0.6-job.jar Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.util.ProgramDriver.driver([Ljava/lang/String;)V at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:116) 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.main(RunJar.java:208)
还没有答案?目前倾向于hadoop与mahout版本冲突造成的。
4 参考资料
标签:
原文地址:http://www.cnblogs.com/hdu-2010/p/5105722.html