从命令行运行Mahout(CLASSPATH) [英] Running Mahout from the command line (CLASSPATH)

查看:183
本文介绍了从命令行运行Mahout(CLASSPATH)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Maven在Windows下成功完成了Mahout。

Complied Mahout successfully under Windows using Maven.

我正在尝试从命令行运行其中一个示例,但我不知道我做错了什么。看起来像CLASSPATH问题。

I'm trying to run one of the examples from the command line and I don't get what I am doing wrong. Seems like a CLASSPATH problem.

假设我想运行GroupLensRecommenderEvaluatorRunner示例。我转到包含GroupLensRecommenderEvaluatorRunner.class文件的文件夹并执行:

Let's say I want to run the GroupLensRecommenderEvaluatorRunner example. I go to the folder with the GroupLensRecommenderEvaluatorRunner.class file in it and execute:

java -cp C:/mahout/core/target/classes;. 

org.apache.mahout.cf.taste.example.grouplens.GroupLensRecommenderEvaluatorRunner



<它给了我GroupLensRecommenderEvaluatorRunner
类的NoClassDefFoundError异常。

It gives me the NoClassDefFoundError exception for the GroupLensRecommenderEvaluatorRunner class.

-cp的路径是错误的吗?

Is the path for -cp wrong?

btw,对于那些不熟悉mahout的人,

btw, for those who aren't familiar with mahout,

org.apache.mahout.cf.taste.example.grouplens

是GroupLensRecommenderEvaluatorRunner类的包。
javadoc

is the package of the GroupLensRecommenderEvaluatorRunner class. javadoc

谢谢你们。

p.s - 我首先查看了之前有关CLASSPATH的stackoverflow问题并遵循给定的解决方案,然后才提出这个问题。

p.s - I first looked on previous stackoverflow questions on CLASSPATH and followed the given solutions, before asking this question.

推荐答案

如果你把 $ MAHOUT_HOME / examples / target / classes 是在java CLASSPATH 中(如Sean所提到的),这将在本地运行时起作用,但您可能必须尝试以下方法进行hadoop集群部署。

If you put $MAHOUT_HOME/examples/target/classes is in the java CLASSPATH (as Sean mentions) this will work when running locally but you'll probably have to try the method below for a hadoop cluster deployment.

我发现以下帖子非常有关如何在mahout / hadoop的各种配置中获得正确的类。

I found the following post very illuminating about how get the right classes in various configurations of mahout/hadoop.

http:// www.cloudera.com/blog/2011/01/how-to-include-third-party-libraries-in-your-map-reduce-job/

mahout脚本在所有情况下都不接受hadoop作业参数(比如--libJar),尽管我希望将来会这样做,特别是在作业的参数是类名(例如seq2sparse)的情况下。

The mahout script does not accept hadoop job parameters (like --libJar) in all cases although I hope it does in the future, especially where a parameter to the job is a classname (seq2sparse for instance).

我要做的是将我的自定义jar复制到mas上的 $ HADOOP_HOME / lib ter节点。显然符号链接不起作用,你似乎必须将你想要的每个jar复制到目录。

What I had to do was copy my custom jar into $HADOOP_HOME/lib on the master node. Evidently a symlink does not work, it appears you have to copy each jar you want to the directory.

然后不要忘记停止并启动hadoop,因为作为cloudera参考说它在启动时打包了lib。

Then don't forget to stop and start hadoop because as the cloudera reference says it packages the libs at startup.

这篇关于从命令行运行Mahout(CLASSPATH)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆