1安装环境
系统/软件明称 | 版本 | 下载地址 | 备注 |
hadoop |
0.20.2 | http://mirror.esocc.com/apache/hadoop/common/ |
|
mahout |
0.4 | http://mirrors.cnnic.cn/apache/mahout/0.4/ |
|
操作系统debain |
6.02 |
hadoop 节点列表
系统明\名称 | hadoop节点 |
ip地址 |
备注 |
debain7 |
namenode |
192.168.1.111 | |
datanode1 |
datanode | 192.168.1.112 |
|
datanode2 |
datanode |
192.168.1.113 |
|
datanode3 |
datanode |
192.168.1.114 |
2安装步骤
2.1 解压mahout-distribution-0.4.tar.gz
1
|
tar
-axvf mahout-distribution-0.4.
tar
.gz
|
2.2 将文件重名为mahout
1
|
mv
mahout-distribution-0.4 mahout
|
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-amd64
export HADOOP_HOME=/usr/local/hadoop
export HADOOP_CONF_DIR=/usr/local/hadoop/conf
export MAHOUT_HOME=/usr/local/mahout
export MAHOUT_CONF_DIR=/usr/local/mahout/conf
export PATH=$PATH:$HADOOP_HOME_DIR:$HADOOP_HOME/bin:$MAHOUT_HOME/conf:$MAHOUT_HOME/bin
2.5 启动hadoop,测试mahout是否安装成功
启动时要退出到最初路径既
1
|
mahout
|
2.6 下载mahout测试数据
wget http://archive.ics.uci.edu/ml/databases/synthetic_control/synthetic_control.data
2.7 hadoop创建测试目录
2.8 上传测试数据
2.9 启动kmeans算法,开始测试
1
|
mahout org.apache.mahout.clustering.syntheticcontrol.kmeans.Job
|
3问题
tianbx@localhost :/usr/local/mahout/bin$ ./mahout --help
MAHOUT_LOCAL is not set; adding HADOOP_CONF_DIR to classpath.
Exception in thread "main" java.lang.NoClassDefFoundError: classpath
Caused by: java.lang.ClassNotFoundException: classpath
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: classpath. Program will exit.
Running on hadoop, using /usr/local/hadoop/bin/hadoop and HADOOP_CONF_DIR=/usr/local/hadoop/conf
原因:一开始我按装的是mahout0.8,而hadoop是0.2,版本之间的兼容问题.
解决办法:不安装mahout0.8,换成mahout0.4 就可以了.
需要资源请联系[email protected]