2010-11-02 63 views
1

嘿,我有2個Solr服務器設置,除了4行XML使它成爲主設備之外,主設備與從設備相同。Solr從屬複製服務器將無法啓動

奴隸然而錯誤,當您嘗試啓動它,我有以下的建立,使之成爲奴隸:

<requestHandler name="/replication" class="solr.ReplicationHandler" > 
<lst name="slave"> 
<str name="masterUrl">http://10.1.2.196:8080/solr/replication</str> 
<str name="pollInterval">00:00:20</str> 
</lst> 
</requestHandler> 

當我註釋掉/複製它工作正常,整個請求處理,但Solr會拋出錯誤並拒絕啓動。

錯誤轉儲是在這裏:

嚴重:無法啓動SOLR。檢查solr/home屬性 java.lang.NoClassDefFoundError:org/apache/commons/logging/LogFactory at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager。(MultiThreadedHttpConnectionManager.java:70) at org.apache.solr.handler。 SnapPuller.createHttpClient(SnapPuller.java:110) at org.apache.solr.handler.SnapPuller。(SnapPuller.java:138) at org.apache.solr.handler.ReplicationHandler.inform(ReplicationHandler.java:775) at org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:486) at org.apache.solr.core.SolrCore。(SolrCore.java:589) at org.apache.solr.core.CoreContainer $ Initializer.initialize(CoreContainer.java:137) at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispat chFilter.java:83) 在org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295) 在org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) 在有機apache.catalina.core.ApplicationFilterConfig。(ApplicationFilterConfig.java:115) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838) at org.apache.catalina.core.StandardContext.start(StandardContext .java:4488) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache .catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apach e.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563) at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:498) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org。 apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start( StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.co (StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java: 710) 在org.apache.catalina.startup.Catalina.start(Catalina.java:593) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本機方法) 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.startup.Bootstrap.start(Bootstrap 。java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 引起:java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory at org.apache.catalina .loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329) ... 35更多 03/11/2010 2:11:12 AM org.apache.solr.core.QuerySenderListener newSearcher INFO:QuerySenderListener向Searcher發送請求@ 207ff5b6主要 03/11/2010 2:11:12 AM org.apache.solr.common.SolrException日誌 SEVERE:java.lang .NoClassDefFoundError:org/apache/commons/logging/LogFactory at org.apache.commons.httpclient.MultiThreade dHttpConnectionManager。(MultiThreadedHttpConnectionManager.java:70) 在org.apache.solr.handler.SnapPuller.createHttpClient(SnapPuller.java:110) 在org.apache.solr.handler.SnapPuller。(SnapPuller.java:138) 在org.apache.solr.handler.ReplicationHandler.inform(ReplicationHandler.java:775) at org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:486) at org.apache.solr.core.SolrCore。 (SolrCore.java:589) 在org.apache.solr.core.CoreContainer $ Initializer.initialize(CoreContainer.java:137) 在org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83) 在org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295) at org.apache.catalina.co re.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) 在org.apache.catalina.core.ApplicationFilterConfig。(ApplicationFilterConfig.java:115) 在org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838 ) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core .ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637 ) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup。 HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core。 StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache。 catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun .reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:616) 在有機.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 引起:java.lang.ClassNotFoundException:org.apache .commons.logging.LogFactory at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader。的java:1484) 在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329) ... 35更

這也是值得注意的是,兩個服務器比在那些線相同的一種配置。

有沒有人遇到過這個?

服務器本身使用解決了一個自定義DATADIR

<dataDir>/var/lib/solr/data</dataDir> ... 35 more 
+0

它說你缺少commons-logging。你檢查過嗎? – 2010-11-02 15:47:17

回答

0

。 Ubuntu沒有將/ usr/share/java添加到Tomcat類路徑中。

+0

褻瀆在這裏不受歡迎。 – meagar 2010-11-02 20:37:55

+0

你應該在郵件列表上回答你的問題;-) – Karussell 2010-11-03 09:33:57

1

這個問題&答案對我非常有幫助。但是,我無法追蹤Tomcat所看到的將'/ usr/share/java'添加到CLASSPATH的'正確'方法,所以我通過將commons-logging.jar鏈接到Solr的lib目錄中來解決它。

sudo ln -s /usr/share/java/commons-logging.jar /usr/share/solr/WEB-INF/lib/commons-logging.jar 

我很想知道如何以更優雅的方式做到這一點。任何提示或輸入?

+0

我將它添加到/etc/tomcat6/catalina.properties - common.loader = $ {catalina.base}/lib,$ {catalina.base}/lib /的* .jar,$ {}的catalina.home/lib下,$ {}的catalina.home/lib目錄/ *。jar複製的/ var/lib中/ tomcat6中/普通/班,在/ var/lib中/ tomcat6中/普通/ *。jar複製/usr/share/java/*.jar – Kura 2011-02-02 09:41:55