Error after upgrading Tomcat6 to Tomcat8: Failed to load configuration for solrconfig.xml file

I ran Solr on Ubuntu 12.04 Tomcat6; we upgraded to 16.04 and Tomcat8 and Solr stopped reading some indexes. I believe the only metrics that have been affected are the ones where the config directory is softs linked. Some Googling later, I found that the attribute allowLinking

was moved. This was my old config:

<!-- /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>

      

I rewrote:

<!-- /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>

      

and even tried in a global context:

<!-- /etc/tomcat8/context.xml -->
<Context>
  <WatchedResource>WEB-INF/web.xml</WatchedResource>
  <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
  <Resources allowLinking="true"/>
</Context>

      

but I was unable to get Solr to load these kernels. The error /var/log/tomcat8/catalina.out

looks like this:

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

      

(午後 means "pm", "重倧" is "serious")

+3


source to share


1 answer


Stupid question, stupid answer.

Tomcat 6 worked under a group tomcat6

. Tomcat 8 works like tomcat8

.



My files were -rw-rw---- amadan:tomcat6

.

Solution: chgrp -R tomcat8 /disks/disk00/solr/

.

+3


source







All Articles