环境:CentOS6.4
依赖: JDK1.6 or later, Maven3
用户权限:root
1. 安装Maven3
cd /usr/local/src
sudo wget http://apache.etoak.com//maven/binaries/apache-maven-3.0.2-bin.tar.gz
tar vxzf apache-maven-3.0.2-bin.tar.gz
sudo mv apache-maven-3.0.2 /usr/local/src/maven
vi ~/.bashrc
添加如下两行
export M3_HOME=/usr/local/maven
export PATH=${M3_HOME}/bin:${PATH}
查看maven版本,看是否安装成功
mvn -version
2.安装Mahout
cd /usr/local/src
sudo mkdir mahout
sudo svn co http://svn.apache.org/repos/asf/mahout/trunk mahout
cd /usr/local/src/mahout
mvn install
3.错误解决
a. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project web_nanchang: There are test failures.
解决:修改pom.xml的<project>配置,使得测试出错不影响项目的编译
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
b. Failed to execute goal on project mahout-integration: Could not resolve dependencies for project org.apache.mahout:mahout-integration:jar:0.8-SNAPSHOT: Could not transfer artifact tomcat:jasper-compiler:jar:5.5.23 from/to central (http://repo.maven.apache.org/maven2): GET request of: tomcat/jasper-compiler/5.5.23/jasper-compiler-5.5.23.jar from central failed: Read timed out -> [Help 1]解决:可能是网络问题,多跑几次
完成之后进入到core目录继续编译安装
cd /usr/local/src/mahout/core
mvn compile
mvn install
3. 安装Hadoop
选择合适的版本http://mirror.bit.edu.cn/apache/hadoop/common/stable/
wget http://mirror.bit.edu.cn/apache/hadoop/common/stable/hadoop-1.0.4-1.x86_64.rpm
rpm -ivh hadoop-1.0.4-1.x86_64.rpm
cd /etc/hadoop
a.修改core-site.xml
- <configuration>
- <property>
- <name>fs.default.name</name>
- <value>hdfs://localhost:9000</value>
- </property>
- </configuration>
- <configuration>
- <property>
- <name>dfs.replication</name>
- <value>1</value>
- </property>
- </configuration>
- <configuration>
- <property>
- <name>mapred.job.tracker</name>
- <value>localhost:9001</value>
- </property>
- </configuration>
执行命令:
#hadoop namenode -format#start-all.sh
查看是否启动成功:
#jps
应该有6个项目如:
5902 DataNode
4745 SecondaryNameNode
6240 Jps
6061 JobTracker
6184 TaskTracker
5770 NameNode
访问地址:
- NameNode - http://localhost:50070/
- JobTracker - http://localhost:50030/