将mahout集成到solr时出错

dohp0rv5  于 2021-06-03  发布在  Hadoop
关注(0)|答案(0)|浏览(228)

我试图将mahout集成到solr中(使用updaterequestprocessor链),但是每当我尝试初始化classifiercontext时,就会出现以下错误。
信息:模型路径:/home/bayes模型

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();

原因是什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题