将mahout集成到solr时出错

时间:2013-04-16 11:36:18

标签: hadoop solr mahout

我正在尝试将mahout集成到solr中(使用updateRequestProcessor链)但是每当我尝试初始化classifierContext时,我都会遇到以下错误。

信息:模型路径:/ home / bayes-model

java.lang.IllegalStateException: /home/bayes-model/trainer-weights/Sigma_j/part-*
    at org.apache.mahout.common.iterator.sequencefile.SequenceFileDirIterable.iterator(SequenceFileDirIterable.java:79)
    at org.apache.mahout.classifier.bayes.SequenceFileModelReader.loadFeatureWeights(SequenceFileModelReader.java:72)
    at org.apache.mahout.classifier.bayes.SequenceFileModelReader.loadModel(SequenceFileModelReader.java:46)
    at org.apache.mahout.classifier.bayes.InMemoryBayesDatastore.initialize(InMemoryBayesDatastore.java:72)
    at org.apache.mahout.classifier.bayes.ClassifierContext.initialize(ClassifierContext.java:44)
    at solr.mypkg.CategorizeDocumentFactory.init(CategorizeDocumentFactory.java:67)
    at org.apache.solr.core.SolrCore.createInitInstance(SolrCore.java:449)
    at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1569)
    at org.apache.solr.update.processor.UpdateRequestProcessorChain.init(UpdateRequestProcessorChain.java:57)
Caused by: javax.security.auth.login.LoginException: unable to find LoginModule 
class: org.apache.hadoop.security.UserGroupInformation$HadoopLoginModule
    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:808)
    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
    at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
    at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
    at org.apache.hadoop.security.UserGroupInformation.getLoginUse

我的代码如下:     params = SolrParams.toSolrParams((NamedList)args);

BayesParameters p = new BayesParameters();
String modelPath = params.get("model");
File file=new File(modelPath);

p.set("basePath",file.getAbsolutePath());
LOG.info("model path :"+file.getAbsolutePath());

p.set("classifierType","bayes");
p.set("dataSource","hdfs");


Datastore ds = new InMemoryBayesDatastore(p);
Algorithm alg = new BayesAlgorithm();
ctx = new ClassifierContext(alg,ds);
ctx.initialize();

可能是什么原因?

0 个答案:

没有答案