Solr 从属复制服务器无法启动
大家好,我设置了 2 个 Solr 服务器,主服务器与从服务器相同,除了 4 行 XML 使其成为主服务器。
然而,当您尝试启动它时,从站会出错,我有以下设置来使其成为从站:
<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>
当我注释掉 /replication 的整个请求处理程序时,它工作正常,但 Solr 会抛出错误并拒绝启动。
错误转储在这里:
严重:无法启动 SOLR。检查 solr/home 属性 java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory 在 org.apache.commons.httpclient.MultiThreadedHttpConnectionManager。(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) 在org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:486) 在 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) 在 org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) 在 org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115) 在 org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838) 在 org.apache.catalina.core.StandardContext.start(StandardContext.java:4488) 在 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) 在 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) 在 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) 在 org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637) 在 org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563) 在 org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498) 在 org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) 在 org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) 在 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) 在 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) 在 org.apache.catalina.core.StandardHost.start(StandardHost.java:722) 在 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) 在 org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) 在 org.apache.catalina.core.StandardService.start(StandardService.java:516) 在 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) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:616) 在 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) 在 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 引起原因:java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory 在 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484) 在 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329) ... 35 更多 03/11/2010 2:11:12 AM org.apache.solr.core.QuerySenderListener newSearcher 信息:QuerySenderListener 向 Searcher@207ff5b6 main 发送请求 03/11/2010 2:11:12 AM org.apache.solr.common.SolrException 日志 严重:java.lang.NoClassDefFoundError:org/apache/commons/logging/LogFactory 在org.apache.commons.httpclient.MultiThreadedHttpConnectionManager。(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) 在org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:486) 在 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) 在 org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) 在 org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115) 在 org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838) 在 org.apache.catalina.core.StandardContext.start(StandardContext.java:4488) 在 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) 在 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) 在 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) 在 org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637) 在 org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563) 在 org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498) 在 org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) 在 org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) 在 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) 在 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) 在 org.apache.catalina.core.StandardHost.start(StandardHost.java:722) 在 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) 在 org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) 在 org.apache.catalina.core.StandardService.start(StandardService.java:516) 在 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) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:616) 在 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) 在 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 引起原因:java.lang.ClassNotFoundException:org.apache.commons.logging.LogFactory 在 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
Hey guys, I have 2 Solr servers set-up, the master is identical to the slave except for the 4 lines of XML that make it a master.
The slave however errors when you try to start it, I have the following set-up to make it a slave:
<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>
When I comment out the entire request handler for /replication it works fine but with it Solr throws and error and refuses to start.
The error dump is here:
SEVERE: Could not start SOLR. Check solr/home property
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(SolrDispatchFilter.java:83)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.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.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)
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)
Caused by: 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 more
03/11/2010 2:11:12 AM org.apache.solr.core.QuerySenderListener newSearcher
INFO: QuerySenderListener sending requests to Searcher@207ff5b6 main
03/11/2010 2:11:12 AM org.apache.solr.common.SolrException log
SEVERE: 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(SolrDispatchFilter.java:83)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.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.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)
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)
Caused by: 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 more
It is also worth noting that both servers are IDENTICAL other than those lines in the config.
Has anyone encountered this before?
The servers themselves use a custom dataDir
<dataDir>/var/lib/solr/data</dataDir> ... 35 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决了。 Ubuntu 没有将 /usr/share/java 添加到 Tomcat 类路径。
Solved. Ubuntu didn't add /usr/share/java to the Tomcat class path.
这个问题&答案对我非常有帮助。但是,我无法找到将 /usr/share/java 添加到 Tomcat 所看到的 CLASSPATH 的“正确”方法,因此我通过将 commons-logging.jar 符号链接到 Solr 的 lib 目录中来解决这个问题:
我很乐意知道如何以更优雅的方式实现这一点。有什么提示或意见吗?
This question & answer were extremely helpful for me. However, I couldn't track down the 'correct' way to add /usr/share/java to the CLASSPATH as seen by Tomcat, so I worked around it by symlinking commons-logging.jar into Solr's lib directory:
I would love to know how to accomplish this in a more graceful fashion. Any tips or input?