Mahout 安装配置

环境: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}

执行 ~/.bashrc,使设置生效
查看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

  1. <configuration>  
  2.      <property>  
  3.          <name>fs.default.name</name>  
  4.          <value>hdfs://localhost:9000</value>  
  5.      </property>  
  6. </configuration>  
b. 修改 hdfs-site.xml: 

  1. <configuration>  
  2.      <property>  
  3.          <name>dfs.replication</name>  
  4.          <value>1</value>  
  5.      </property>  
  6. </configuration>  
c. 修改 mapred-site.xml: 

  1. <configuration>  
  2.      <property>  
  3.          <name>mapred.job.tracker</name>  
  4.          <value>localhost:9001</value>  
  5.      </property>  
  6. </configuration>  

执行命令:

#hadoop namenode -format

#start-all.sh 

查看是否启动成功:

#jps

应该有6个项目如:

5902 DataNode
4745 SecondaryNameNode
6240 Jps
6061 JobTracker
6184 TaskTracker
5770 NameNode

访问地址:

  1. NameNode - http://localhost:50070/  
  2. JobTracker - http://localhost:50030/ 





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值