First, download the binary file click on the Open link
Second, extract the file
TAR-ZXVF mahout-distribution-0.9.tar.gz-c/usr
Third, configure environment variables: in/etc/profile, add mahout_home environment variables
Export mahout_home=/usr/apache-mahout-distribution-0.12.2
Export path= $PATH: $HADOOP _home/bin: $MAHOUT _home/bin
Export classpath=.: $JAVA _home/lib: $MAHOUT _home/lib: $JRE _home/lib: $CLASSPATH
Note: Be sure to execute the command-source/etc/profile after modifying the environment variable
Four, start Hadoop
start-all.sh
V. View the mahout version
Mahout--help
Vi. Use of Mahout
A. Download a file Synthetic_control.data, download the address Http://archive.ics.uci.edu/ml/databases/synthetic_control/synthetic_ Control.data, and put this file in the $mahout_home directory.
B. Start HADOOP: $HADOOP _home/bin/start-all.sh
C. Create test directory input and import data into this input directory
root@master# Hadoop Fs-mkdir Input
root@master:~/$ Hadoop fs-put/home/zc/desktop/synthetic_control.data Input
D. Use the Kmeans algorithm (which will run for a few minutes)
root@master~/$ Hadoop Jar/usr/apache-mahout-distribution-0.12.2/mahout-examples-0.12.2.jar Org.apache.mahout.clustering.syntheticcontrol.kmeans.Job
E. Viewing results
Hadoop fs-cat/output/data/part-m-00000