mahout安装和配置简明步骤

①在官网下载最新的mahout版本,放在linux本机系统的/usr/local/目录下,然后解压即可

tar -zxvf mahout-distribution-0.9.tar.gz

②重命名解压后的文件夹为mahout

mv mahout-distribution-0.9 mahout

③执行vi /etc/profile 配置mahout的环境,内容如下:

4d798668-401e-4e92-9879-07101600d2c6[4]

④执行source /etc/profile使得配置文件立即生效

⑤下载测试数据进行测试:

下载一个文件synthetic_control.data,下载地址http://archive.ics.uci.edu/ml/databases/synthetic_control/synthetic_control.data

将下载后的文件上传到hdfs的/user/root/testdata/目录下(注:我使用的是root用户登录)

⑥使用means算法进行测试,执行

hadoop jar /usr/local/mahout/mahout-examples-0.9-job.jar org.apache.mahout.clustering.syntheticcontrol.kmeans.Job

不一会儿的功夫,在hdfs文件系统的/user/root/output目录下产生分类好的数据。

2cfacb8f-6d39-404c-8492-2be684f7e791[8]

原文地址:https://www.cnblogs.com/wyhuang/p/3887292.html