Linux

在 SOLR4 上啟用 DIH 時出錯

  • February 7, 2014

我有點卡在這裡。我讓 Solr4.4 工作沒有太多問題。我想啟用 DIH,所以我首先將這些行添加到 solrconfig.xml:

<lib dir="../contrib/dataimporthandler/lib" regex=".*\.jar" />
<lib dir="../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />

重新啟動,一切都很好。然後我也將這些行添加到配置中,這破壞了 Solr:

<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
   <lst name="defaults">
     <str name="config">/opt/solr/collection1/conf/data-config.xml</str>
   </lst>
 </requestHandler>

這是它給我的錯誤:

HTTP ERROR 500 

Problem accessing /solr/. Reason: 

   {msg=SolrCore 'collection1' is not available due to init failure: RequestHandler init failure,trace=org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: RequestHandler init failure 
       at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:860) 
       at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:251) 
       at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:158) 
       at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1486) 
       at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503) 
       at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138) 
       at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:540) 
       at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213) 
       at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1094) 
       at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:432) 
       at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175) 
       at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1028) 
       at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) 
       at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:258) 
       at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) 
       at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) 
       at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:317) 
       at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) 
       at org.eclipse.jetty.server.Server.handle(Server.java:445) 
       at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:267) 
       at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:224) 
       at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358) 
       at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601) 
       at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532) 
       at java.lang.Thread.run(Thread.java:724) 
Caused by: org.apache.solr.common.SolrException: RequestHandler init failure 
       at org.apache.solr.core.SolrCore.<init>(SolrCore.java:835) 
       at org.apache.solr.core.SolrCore.<init>(SolrCore.java:629) 
       at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:622) 
       at org.apache.solr.core.CoreContainer.create(CoreContainer.java:657) 
       at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:364) 
       at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:356) 
       at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
       at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
       at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
       at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
       ... 1 more 
Caused by: org.apache.solr.common.SolrException: RequestHandler init failure 
       at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:167) 
       at org.apache.solr.core.SolrCore.<init>(SolrCore.java:772) 
       ... 13 more 
Caused by: org.apache.solr.common.SolrException: Error loading class 'org.apache.solr.handler.dataimport.DataImportHandler' 
       at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:449) 
       at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:381) 
       at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:530) 
       at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:603) 
       at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:153) 
       ... 14 more 
Caused by: java.lang.ClassNotFoundException: org.apache.solr.handler.dataimport.DataImportHandler 
       at java.net.URLClassLoader$1.run(URLClassLoader.java:366) 
       at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
       at java.security.AccessController.doPrivileged(Native Method) 
       at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
       at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 
       at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:787) 
       at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 
       at java.lang.Class.forName0(Native Method) 
       at java.lang.Class.forName(Class.java:270) 
       at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:433) 
       ... 18 more 
,code=500}

有人能告訴我我做錯了什麼嗎?一旦我刪除這些行,一切都會再次執行。

看起來您可能沒有將 data-config.xml 放在它期望查找的位置。( /opt/solr/collection1/conf/data-config.xml)

請參閱http://wiki.apache.org/solr/DIHQuickStart中的第 2 步

iI您不再使用collection1作為您的核心(例如DIH沒有),系統重啟可能會有所幫助 - 它適用於我遇到的類似問題。我想有一些不穩定的儲存設置。如果這不可行,我建議追踪相關的屬性文件並檢查或刪除它們……

引用自:https://serverfault.com/questions/529579