我在Ubuntu 12.04 Tomcat6上运行Solr;我们升级到16.04和Tomcat8,Solr停止阅读一些索引。我相信唯一受影响的索引是配置目录是软链接的索引。一些谷歌搜索后,我发现allowLinking
属性被移动。这是我的旧配置:
<!-- /etc/tomcat6/Catalina/localhost/solr.xml -->
<Context path="/solr" docBase="/usr/share/solr"
debug="0" privileged="true" allowLinking="true" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/usr/share/solr" override="true" />
</Context>
我改写为:
<!-- /etc/tomcat8/Catalina/localhost/solr.xml -->
<Context path="/solr" docBase="/usr/share/solr"
privileged="true" crossContext="true">
<Resources allowLinking="true" />
<Environment name="solr/home" type="java.lang.String" value="/usr/share/solr" override="true" />
</Context>
甚至在全球范围内尝试过:
<!-- /etc/tomcat8/context.xml -->
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Resources allowLinking="true"/>
</Context>
但我无法让Solr加载这些核心。 /var/log/tomcat8/catalina.out
中的错误如下:
3 27, 2017 2:22:33 午後 org.apache.solr.core.CoreContainer recordAndThrow
重大: Unable to create core: blacklight-core
org.apache.solr.common.SolrException: Could not load config for solrconfig.xml
at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:973)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1033)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:624)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or '/disks/disk00/solr/library/blacklight-core/conf/', cwd=/var/lib/tomcat8
at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:316)
at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:281)
at org.apache.solr.core.Config.<init>(Config.java:103)
at org.apache.solr.core.Config.<init>(Config.java:73)
at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:117)
at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:971)
... 9 more
(午后的意思是“pm”,“重大”是“严肃的”)
答案 0 :(得分:3)
愚蠢的问题,愚蠢的回答。
Tomcat 6在组tomcat6
下运行。 Tomcat 8运行为tomcat8
。
我的文件是-rw-rw---- amadan:tomcat6
。
解决方案:chgrp -R tomcat8 /disks/disk00/solr/
。