how can I compile/using mahout for hadoop 2.0?

五迷三道 提交于 2019-12-05 12:01:02

To compile Mahout to work with 2.x since it isn't released in a package that is compatible with Hadoop 2.x:

mvn clean install -Dhadoop2 -Dhadoop2.version=2.2.0 -DskipTests=true

If you want to confirm after the build that the correct dependencies were brought in, run the following from the root of the project:

find . -name hadoop*.jar

The artifacts generated by the above command differ from what's in the 0.9 release so you'll need to update more than just the version number (there seems to be a new mahout-mrlegacy jar).

That being said, if someone can point me to an official artifact that runs with 2.x (even if it's a SNAPSHOT), I'd appreciate it.

Did you try changing the version of hadoop in the pom.xml?

<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>                                                   
<version> 0.23.9</version> 

(Please check the version of hadoop. As I understand, 0.23 became 2.0)

Another thing to try is to run the RecommenderJob directly like this:

bin/mahout recommenditembased \
   --input INPUT --output OUTPUT \
   --tempDir TEMP --similarityClassname SIMILARITY_LOGLIKELIHOOD

To run this you have to be in the root of your mahout folder, and you need to have the following environment variables set:

export HADOOP_HOME=/path/to/hadoop/home
export HADOOP_COMMONS_HOME=/path/to/commons/home
export JAVA_HOME=/path/to/java/home
export PATH="$PATH:$HADOOP_HOME/bin"

About an hour ago Mahout has officially added support to Hadoop 2.x on the master branch (see MAHOUT-1329)

Checkout the code here https://github.com/apache/mahout and recompile using:

mvn clean package -Dhadoop2.version=2.2.0

Try and see if that works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!