如何修复因init失败而无法使用的'collection1':无法创建目录?

时间:2013-11-06 06:43:08

标签: exception solr tomcat7

我在Ubuntu 13.10中使用tomcat 7安装solr 4.5.1。

我总是遇到错误:

org.apache.solr.core.CoreContainer; Unable to create core: collection1
org.apache.solr.common.SolrException: Cannot create directory: /opt/solr/example/solr/collection1/data

当我在data为Solr创建data/indexcollection1个文件夹时,它给了我错误:

org.apache.solr.common.SolrException: Lock obtain timed out: NativeFSLock@/opt/solr/example/solr/collection1/data/index/write.lock: java.io.FileNotFoundException: /opt/solr/example/solr/collection1/data/index/write.lock (Permission denied)

我在同一个词典中尝试过jetty模式,但效果很好。

以下是solrconfig.xml

<?xml version="1.0" encoding="UTF-8" ?>
<config>
<luceneMatchVersion>4.5</luceneMatchVersion>
<lib dir="../../../contrib/extraction/lib" regex=".*\.jar" />
<lib dir="../../../dist/" regex="solr-cell-\d.*\.jar" />
<lib dir="../../../contrib/clustering/lib/" regex=".*\.jar" />
<lib dir="../../../dist/" regex="solr-clustering-\d.*\.jar" />
<lib dir="../../../contrib/langid/lib/" regex=".*\.jar" />
<lib dir="../../../dist/" regex="solr-langid-\d.*\.jar" />
<lib dir="../../../contrib/velocity/lib" regex=".*\.jar" />
<lib dir="../../../dist/" regex="solr-velocity-\d.*\.jar" />
<dataDir>${solr.data.dir:}</dataDir>
...

solrconfig.xml文件与solr创建的文件相同。

以下是solr.log中的消息:

INFO  - 2013-11-06 11:12:59.479; org.apache.solr.servlet.SolrDispatchFilter;      SolrDispatchFilter.init()
INFO  - 2013-11-06 11:12:59.506; org.apache.solr.core.SolrResourceLoader; Using JNDI solr.home: /opt/solr/example/solr
INFO  - 2013-11-06 11:12:59.508; org.apache.solr.core.SolrResourceLoader; new SolrResourceLoader for directory: '/opt/solr/example/solr/'
INFO  - 2013-11-06 11:12:59.791; org.apache.solr.core.ConfigSolr; Loading container configuration from /opt/solr/example/solr/solr.xml
INFO  - 2013-11-06 11:13:00.180; org.apache.solr.core.ConfigSolrXml; Config-defined core root directory: 
INFO  - 2013-11-06 11:13:00.200; org.apache.solr.core.CoreContainer; New CoreContainer 2105334598
INFO  - 2013-11-06 11:13:00.200; org.apache.solr.core.CoreContainer; Loading cores into CoreContainer [instanceDir=/opt/solr/example/solr/]
INFO  - 2013-11-06 11:13:00.263; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting socketTimeout to: 0
INFO  - 2013-11-06 11:13:00.264; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting urlScheme to: http://
INFO  - 2013-11-06 11:13:00.264; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting connTimeout to: 0
INFO  - 2013-11-06 11:13:00.264; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maxConnectionsPerHost to: 20
INFO  - 2013-11-06 11:13:00.264; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting corePoolSize to: 0
INFO  - 2013-11-06 11:13:00.265; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maximumPoolSize to: 2147483647
INFO  - 2013-11-06 11:13:00.265; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting maxThreadIdleTime to: 5
INFO  - 2013-11-06 11:13:00.265; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting sizeOfQueue to: -1
INFO  - 2013-11-06 11:13:00.265; org.apache.solr.handler.component.HttpShardHandlerFactory; Setting fairnessPolicy to: false
INFO  - 2013-11-06 11:13:00.283; org.apache.solr.client.solrj.impl.HttpClientUtil; Creating new http client, config:maxConnectionsPerHost=20&maxConnections=10000&socketTimeout=0&connTimeout=0&retry=false
INFO  - 2013-11-06 11:13:00.744; org.apache.solr.logging.LogWatcher; SLF4J impl is org.slf4j.impl.Log4jLoggerFactory
INFO  - 2013-11-06 11:13:00.745; org.apache.solr.logging.LogWatcher; Registering Log Listener [Log4j (org.slf4j.impl.Log4jLoggerFactory)]
INFO  - 2013-11-06 11:13:00.839; org.apache.solr.core.CorePropertiesLocator; Looking for core definitions underneath /opt/solr/example/solr
INFO  - 2013-11-06 11:13:00.920; org.apache.solr.core.CorePropertiesLocator; Found core collection1 in /opt/solr/example/solr/collection1/
INFO  - 2013-11-06 11:13:00.921; org.apache.solr.core.CorePropertiesLocator; Found 1 core definitions
INFO  - 2013-11-06 11:13:00.929; org.apache.solr.core.CoreContainer; Creating SolrCore 'collection1' using instanceDir: /opt/solr/example/solr/collection1
INFO  - 2013-11-06 11:13:00.941; org.apache.solr.core.SolrResourceLoader; new SolrResourceLoader for directory: '/opt/solr/example/solr/collection1/'
INFO  - 2013-11-06 11:13:01.082; org.apache.solr.core.SolrConfig; Adding specified lib dirs to ClassLoader
INFO  - 2013-11-06 11:13:01.087; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/fontbox-1.8.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.087; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/poi-scratchpad-3.9.jar' to classloader
INFO  - 2013-11-06 11:13:01.087; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/netcdf-4.2-min.jar' to classloader
INFO  - 2013-11-06 11:13:01.087; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/xz-1.0.jar' to classloader
INFO  - 2013-11-06 11:13:01.087; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/metadata-extractor-2.6.2.jar' to classloader
INFO  - 2013-11-06 11:13:01.088; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/bcprov-jdk15-1.45.jar' to classloader
INFO  - 2013-11-06 11:13:01.088; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/jempbox-1.8.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.088; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/poi-ooxml-3.9.jar' to classloader
INFO  - 2013-11-06 11:13:01.088; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/tika-parsers-1.4.jar' to classloader
INFO  - 2013-11-06 11:13:01.089; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/commons-compress-1.4.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.089; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/isoparser-1.0-RC-1.jar' to classloader
INFO  - 2013-11-06 11:13:01.089; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/apache-mime4j-core-0.7.2.jar' to classloader
INFO  - 2013-11-06 11:13:01.089; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/juniversalchardet-1.0.3.jar' to classloader
INFO  - 2013-11-06 11:13:01.090; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/icu4j-49.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.090; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/dom4j-1.6.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.090; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/tagsoup-1.2.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.090; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/pdfbox-1.8.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.090; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/xmlbeans-2.3.0.jar' to classloader
INFO  - 2013-11-06 11:13:01.091; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/poi-3.9.jar' to classloader
INFO  - 2013-11-06 11:13:01.091; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/tika-core-1.4.jar' to classloader
INFO  - 2013-11-06 11:13:01.091; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/boilerpipe-1.1.0.jar' to classloader
INFO  - 2013-11-06 11:13:01.091; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/poi-ooxml-schemas-3.9.jar' to classloader
INFO  - 2013-11-06 11:13:01.091; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/xercesImpl-2.9.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.091; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/vorbis-java-core-0.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.092; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/vorbis-java-tika-0.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.092; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/rome-0.9.jar' to classloader
INFO  - 2013-11-06 11:13:01.092; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/jdom-1.0.jar' to classloader
INFO  - 2013-11-06 11:13:01.092; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/bcmail-jdk15-1.45.jar' to classloader
INFO  - 2013-11-06 11:13:01.093; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/extraction/lib/apache-mime4j-dom-0.7.2.jar' to classloader
INFO  - 2013-11-06 11:13:01.125; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/dist/solr-cell-4.5.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.129; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/clustering/lib/jackson-mapper-asl-1.7.4.jar' to classloader
INFO  - 2013-11-06 11:13:01.129; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/clustering/lib/carrot2-mini-3.8.0.jar' to classloader
INFO  - 2013-11-06 11:13:01.129; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/clustering/lib/jackson-core-asl-1.7.4.jar' to classloader
INFO  - 2013-11-06 11:13:01.130; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/clustering/lib/hppc-0.5.2.jar' to classloader
INFO  - 2013-11-06 11:13:01.130; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/clustering/lib/mahout-collections-1.0.jar' to classloader
INFO  - 2013-11-06 11:13:01.130; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/clustering/lib/mahout-math-0.6.jar' to classloader
INFO  - 2013-11-06 11:13:01.130; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/clustering/lib/attributes-binder-1.2.0.jar' to classloader
INFO  - 2013-11-06 11:13:01.130; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/clustering/lib/simple-xml-2.7.jar' to classloader
INFO  - 2013-11-06 11:13:01.131; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/dist/solr-clustering-4.5.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.133; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/langid/lib/jsonic-1.2.7.jar' to classloader
INFO  - 2013-11-06 11:13:01.133; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/langid/lib/langdetect-1.1-20120112.jar' to classloader
INFO  - 2013-11-06 11:13:01.134; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/dist/solr-langid-4.5.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.135; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/velocity/lib/commons-beanutils-1.7.0.jar' to classloader
INFO  - 2013-11-06 11:13:01.136; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/velocity/lib/velocity-tools-2.0.jar' to classloader
INFO  - 2013-11-06 11:13:01.137; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/velocity/lib/commons-collections-3.2.1.jar' to classloader
INFO  - 2013-11-06 11:13:01.137; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/contrib/velocity/lib/velocity-1.7.jar' to classloader
INFO  - 2013-11-06 11:13:01.137; org.apache.solr.core.SolrResourceLoader; Adding 'file:/opt/solr/dist/solr-velocity-4.5.1.jar' to classloader
INFO  - 2013-11-06 11:13:02.100; org.apache.solr.update.SolrIndexConfig; IndexWriter infoStream solr logging is enabled
INFO  - 2013-11-06 11:13:02.107; org.apache.solr.core.SolrConfig; Using Lucene MatchVersion: LUCENE_45
INFO  - 2013-11-06 11:13:02.421; org.apache.solr.core.SolrConfig; Loaded SolrConfig: solrconfig.xml
INFO  - 2013-11-06 11:13:02.429; org.apache.solr.schema.IndexSchema; Reading Solr Schema from schema.xml
INFO  - 2013-11-06 11:13:02.648; org.apache.solr.schema.IndexSchema; [collection1] Schema name=example
INFO  - 2013-11-06 11:13:03.770; org.apache.solr.schema.IndexSchema; unique key field: id
INFO  - 2013-11-06 11:13:03.977; org.apache.solr.schema.FileExchangeRateProvider; Reloading exchange rates from file currency.xml
INFO  - 2013-11-06 11:13:03.996; org.apache.solr.schema.FileExchangeRateProvider; Reloading exchange rates from file currency.xml
INFO  - 2013-11-06 11:13:04.302; org.apache.solr.core.SolrCore; solr.NRTCachingDirectoryFactory
INFO  - 2013-11-06 11:13:04.313; org.apache.solr.core.SolrCore; [collection1] Opening new SolrCore at /opt/solr/example/solr/collection1/, dataDir=/opt/solr/example/solr/collection1/data/
INFO  - 2013-11-06 11:13:04.314; org.apache.solr.core.JmxMonitoredMap; JMX monitoring is enabled. Adding Solr mbeans to JMX Server: com.sun.jmx.mbeanserver.JmxMBeanServer@3527c4a
INFO  - 2013-11-06 11:13:04.350; org.apache.solr.core.SolrCore; [collection1] Added SolrEventListener for newSearcher: org.apache.solr.core.QuerySenderListener{queries=[]}
INFO  - 2013-11-06 11:13:04.351; org.apache.solr.core.SolrCore; [collection1] Added SolrEventListener for firstSearcher: org.apache.solr.core.QuerySenderListener{queries=[{q=static firstSearcher warming in solrconfig.xml}]}
INFO  - 2013-11-06 11:13:04.392; org.apache.solr.core.CachingDirectoryFactory; return new directory for /opt/solr/example/solr/collection1/data
INFO  - 2013-11-06 11:13:04.392; org.apache.solr.core.SolrCore; New index directory detected: old=null new=/opt/solr/example/solr/collection1/data/index/
WARN  - 2013-11-06 11:13:04.393; org.apache.solr.core.SolrCore; [collection1] Solr index directory '/opt/solr/example/solr/collection1/data/index' doesn't exist. Creating new index...
INFO  - 2013-11-06 11:13:04.407; org.apache.solr.core.CachingDirectoryFactory; return new directory for /opt/solr/example/solr/collection1/data/index
INFO  - 2013-11-06 11:13:04.435; org.apache.solr.core.CachingDirectoryFactory; looking to close /opt/solr/example/solr/collection1/data/index [CachedDir<<refCount=0;path=/opt/solr/example/solr/collection1/data/index;done=true>>]
INFO  - 2013-11-06 11:13:04.441; org.apache.solr.core.CachingDirectoryFactory; Closing directory: /opt/solr/example/solr/collection1/data/index
INFO  - 2013-11-06 11:13:04.441; org.apache.solr.core.SolrCore; [collection1]  CLOSING SolrCore org.apache.solr.core.SolrCore@1cb4ab3e
INFO  - 2013-11-06 11:13:04.442; org.apache.solr.update.SolrCoreState; Closing SolrCoreState
INFO  - 2013-11-06 11:13:04.442; org.apache.solr.update.DefaultSolrCoreState; SolrCoreState ref count has reached 0 - closing IndexWriter
INFO  - 2013-11-06 11:13:04.443; org.apache.solr.core.SolrCore; [collection1] Closing main searcher on request.
INFO  - 2013-11-06 11:13:04.443; org.apache.solr.core.CachingDirectoryFactory; Closing NRTCachingDirectoryFactory - 1 directories currently being tracked
INFO  - 2013-11-06 11:13:04.443; org.apache.solr.core.CachingDirectoryFactory; looking to close /opt/solr/example/solr/collection1/data [CachedDir<<refCount=0;path=/opt/solr/example/solr/collection1/data;done=false>>]
INFO  - 2013-11-06 11:13:04.444; org.apache.solr.core.CachingDirectoryFactory; Closing directory: /opt/solr/example/solr/collection1/data
ERROR - 2013-11-06 11:13:04.445; org.apache.solr.core.CoreContainer; Unable to create core: collection1
org.apache.solr.common.SolrException: Cannot create       directory: /opt/solr/example/solr/collection1/data/index
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:834)
 Caused by: java.io.IOException: Cannot create  directory: /opt/solr/example/solr/collection1/data/index
at org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:171)
at org.apache.lucene.store.Lock.obtain(Lock.java:72)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:695)
at org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:77)
at org.apache.solr.update.SolrIndexWriter.create(SolrIndexWriter.java:64)
at org.apache.solr.core.SolrCore.initIndex(SolrCore.java:506)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:755)
... 11 more
  ERROR - 2013-11-06 11:13:04.448; org.apache.solr.common.SolrException; null:org.apache.solr.common.SolrException: Unable to create core: collection1
at org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:934)
Caused by: org.apache.solr.common.SolrException: Cannot create directory: /opt/solr/example/solr/collection1/data/index
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:834)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:625)
at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:522)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:557)
... 8 more
Caused by: java.io.IOException: Cannot create directory: /opt/solr/example/solr/collection1/data/index
at org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:171)
... 11 more

 INFO  - 2013-11-06 11:13:04.451; org.apache.solr.servlet.SolrDispatchFilter; user.dir=/var/lib/tomcat7
INFO  - 2013-11-06 11:13:04.451; org.apache.solr.servlet.SolrDispatchFilter; SolrDispatchFilter.init() done
ERROR - 2013-11-06 11:13:05.373; org.apache.solr.update.SolrIndexWriter; SolrIndexWriter was not closed prior to finalize(), indicates a bug -- POSSIBLE RESOURCE LEAK!!!
ERROR - 2013-11-06 11:13:05.400; org.apache.solr.update.SolrIndexWriter; Error closing IndexWriter, trying rollback

有人有想法吗?感谢

我发现问题是因为文件夹的私密性。在我将$SOLR_HOME及其子字典的所有者更改为tomcat7之后,它就有用了。

5 个答案:

答案 0 :(得分:10)

对于运行Solr的服务器,该文件夹必须是可写的。

请检查/opt/solr/example/solr/collection1/

文件夹权限和启用写入,如:

sudo chmod a+w /opt/solr/example/solr/collection1/ -R

或更改文件夹所有者:

sudo chown tomcat7. /opt/solr/example/solr/collection1/ -R

答案 1 :(得分:3)

引用SOLR-3753问题:

&#34;在没有solr.xml文件的情况下,当前的4.0行为是使用CoreContainer.java中声明的默认值。这需要记录在案;可能在solr.xml和/或CoreAdmin页面上。 (参见CoreAdmin.java的第94行,其中声明了默认名称&#34; collection1&#34;如果没有此文档,用户可能会对&#34; collection1&#34;核心名称的来源感到困惑。(I& #39; m其中之一)。&#34;

因此,一个简单的解决方案是在$ SOLR_HOME / examples / solr /

下创建一个solr.xml文件

参考 SOLR-3753

答案 2 :(得分:1)

检查权限并确保tomcat7可以读写solr主目录和子目录。然后在您上面发布的solrconfig.xml文件中,请参阅以下行:     <dataDir>${solr.data.dir:}</dataDir>

${solr.data.dir:}替换为数据目录的路径,您还必须创建并确保读/写权限,如下所示:

<dataDir>${solr.data.dir:/home/solr/solr-4.6.0/example/solr/collection1/data}</dataDir>

然后保存,并在Tomcat管理器中重新启动solr应用程序,或者只是:     #sudo service tomcat7 restart`

这些是我使用Tomcat 7和Solr 4.6设置的命令和路径,因此您的命令和路径可能会有所不同。我创建了一个solr用户并将他添加到tomcat 7组,但还有许多其他方法可以使权限工作并保持安全性。我还必须在solr.xml中使用tomcat7所有权创建一个/etc/tomcat7/Catalina/localhost文件,其中包含以下行:

<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/home/solr/solr-4.6.0/dist/solr-4.6.0.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/home/solr/solr-4.6.0/example/solr" override="true"/>
</Context>

再次,在Tomcat管理器GUI中停止并启动solr。 希望这有帮助!

答案 3 :(得分:0)

我使用了与spring tc服务器一起部署的SOLR 4.7.1并遇到了同样的错误。 &#34; collection1&#34;在某处硬编码并查找此目录,如果找不到,则会失败。为了使它工作,我复制了&#34;集合1&#34;从examples目录到我的solr-home,能够启动服务器。后来我卸载了collection1,因为我不需要那个。

答案 4 :(得分:0)

复制文件夹examples / collections的所有内容并将其移动到tomcat / solr。然后将文件solr.xml复制到solr文件夹。 重启你的tomcat7。

访问你的solr ui,一切都应该没问题。 对于在tomcat7下运行的Solr ver 4.x。