我正在使用带有rails 4.2.2的Solr V5.3.1和sunspot-solr是ubuntu 15.04上的rails gem
我有Solr初始化失败:
SolrCore Initialization Failures
production: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core production: Error loading solr config from /var/solr/data/production/conf/solrconfig.xml
Please check your logs for more information
日志如下(solr.log):
2015-12-09 14:29:28.634 ERROR (qtp1450821318-17) [ ] o.a.s.c.SolrCore org.apache.solr.common.SolrException: Error CREATEing SolrCore 'production': Unable to create core [production] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/var/solr/data/production/conf'
at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:662)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestInternal(CoreAdminHandler.java:214)
at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:194)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)
at org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:675)
at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:443)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:214)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:179)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Unable to create core [production]
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:737)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:697)
at org.apache.solr.handler.admin.CoreAdminHandler.handleCreateAction(CoreAdminHandler.java:629)
... 27 more
Caused by: org.apache.solr.common.SolrException: Could not load conf for core production: Error loading solr config from /var/solr/data/production/conf/solrconfig.xml
at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:80)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:721)
... 29 more
Caused by: org.apache.solr.common.SolrException: Error loading solr config from /var/solr/data/production/conf/solrconfig.xml
at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:186)
at org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:94)
at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:74)
... 30 more
Caused by: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'solrconfig.xml' in classpath or '/var/solr/data/production/conf'
at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:363)
at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:309)
at org.apache.solr.core.Config.<init>(Config.java:122)
at org.apache.solr.core.Config.<init>(Config.java:92)
at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:201)
at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:178)
... 32 more
2015-12-09 14:29:28.635 INFO (qtp1450821318-17) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/cores params={schema=schema.xml&dataDir=data&name=production&indexInfo=false&action=CREATE&collection=&shard=&wt=json&instanceDir=production&config=solrconfig.xml&_=1449671367929} status=400 QTime=674
2015-12-09 14:29:39.624 INFO (qtp1450821318-19) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/info/properties params={wt=json&_=1449671379587} status=0 QTime=8
2015-12-09 14:29:41.793 INFO (qtp1450821318-18) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/info/logging params={wt=json&since=0&_=1449671381576} status=0 QTime=188
2015-12-09 14:29:52.103 INFO (qtp1450821318-14) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/info/logging params={wt=json&since=1449671368634&_=1449671392070} status=0 QTime=0
2015-12-09 14:30:02.145 INFO (qtp1450821318-17) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/info/logging params={wt=json&since=1449671368634&_=1449671402114} status=0 QTime=0
2015-12-09 14:30:05.817 INFO (qtp1450821318-15) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/cores params={wt=json&_=1449671405761} status=0 QTime=24
2015-12-09 14:40:20.780 INFO (qtp1450821318-17) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/cores params={indexInfo=false&wt=json&_=1449672020748} status=0 QTime=1
2015-12-09 14:40:20.839 INFO (qtp1450821318-12) [ ] o.a.s.s.SolrDispatchFilter [admin] webapp=null path=/admin/info/system params={wt=json&_=1449672020806} status=0 QTime=5
该错误表明它无法在/var/solr/data/production/conf/solrconfig.xml中找到solrconfig.xml - 事实上,该文件不存在。
存在Infact / var / solr / data,但/ var / solr / data / production不存在! / var / solr / data包含一个solr.xml文件
有人可以帮助我了解我错过了哪一部分solr设置 - 以及帮助我完成配置的指南。
答案 0 :(得分:0)
问题是我只是简单地安装并启动了solr,而没有实际创建一个名为'production'的集合。
我是通过执行
来做到这一点的 /opt/solr/bin/solr create -c production
作为用户solr
,它现在完全按照我的预期运作!