You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by es...@oreillyauto.com on 2015/10/09 18:03:57 UTC

How do I set up custom collection cores?

We are installing Alfresco One 5.0.1 with solr4 on a server that has an
existing instance of tomcat7.  I am trying to find some better
documentation on how to setup our cores.  In the solr4.xml located
at /etc/tomcat7/Catalina/localhost has this inside of it.

<?xml version='1.0' encoding='UTF-8'?>
<Context debug="0" crossContext="true">
</Context>

Then at /data/alfresco/alf_data/solr4/solr4.xml I have:

<?xml version='1.0' encoding='UTF-8'?><solr sharedLib="lib"
persistent="true">
<cores adminPath="/admin/cores"
adminHandler="org.alfresco.solr.AlfrescoCoreAdminHandler">
  <core name="archive" instanceDir="archive-SpacesStore"/>
  <core name="alfresco" instanceDir="workspace-SpacesStore"/>
</cores>
</solr>

This is what I get in the catalina.out showing that it is trying to create
collection1

2015-10-09 08:31:42,789  ERROR [solr.core.CoreContainer]
[coreLoadExecutor-5-thread-1] Unable to create core: collection1
 org.apache.solr.common.SolrException: Could not load core configuration
for core collection1
        at org.apache.solr.core.ConfigSetService.getConfig
(ConfigSetService.java:66)
        at org.apache.solr.core.CoreContainer.create
(CoreContainer.java:554)
        at org.apache.solr.core.CoreContainer$1.call
(CoreContainer.java:261)
        at org.apache.solr.core.CoreContainer$1.call
(CoreContainer.java:253)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call
(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker
(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Error loading solr config
from solr/collection1/solrconfig.xml
        at org.apache.solr.core.SolrConfig.readFromResourceLoader
(SolrConfig.java:148)
        at org.apache.solr.core.ConfigSetService.createSolrConfig
(ConfigSetService.java:79)
        at org.apache.solr.core.ConfigSetService.getConfig
(ConfigSetService.java:61)
        ... 9 more
Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in
classpath or '/var/lib/tomcat7/solr/collection1/conf'
        at org.apache.solr.core.SolrResourceLoader.openResource
(SolrResourceLoader.java:362)
        at org.apache.solr.core.SolrResourceLoader.openConfig
(SolrResourceLoader.java:308)
        at org.apache.solr.core.Config.<init>(Config.java:116)
        at org.apache.solr.core.Config.<init>(Config.java:86)
        at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:161)
        at org.apache.solr.core.SolrConfig.readFromResourceLoader
(SolrConfig.java:144)
        ... 11 more
2015-10-09 08:31:42,808  ERROR [solr.core.CoreContainer]
[coreLoadExecutor-5-thread-1] null:org.apache.solr.common.SolrException:
Unable to create core: collection1
        at org.apache.solr.core.CoreContainer.recordAndThrow
(CoreContainer.java:911)
        at org.apache.solr.core.CoreContainer.create
(CoreContainer.java:568)
        at org.apache.solr.core.CoreContainer$1.call
(CoreContainer.java:261)
        at org.apache.solr.core.CoreContainer$1.call
(CoreContainer.java:253)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call
(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker
(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Could not load core
configuration for core collection1
        at org.apache.solr.core.ConfigSetService.getConfig
(ConfigSetService.java:66)
        at org.apache.solr.core.CoreContainer.create
(CoreContainer.java:554)
        ... 8 more
Caused by: org.apache.solr.common.SolrException: Error loading solr config
from solr/collection1/solrconfig.xml
        at org.apache.solr.core.SolrConfig.readFromResourceLoader
(SolrConfig.java:148)
        at org.apache.solr.core.ConfigSetService.createSolrConfig
(ConfigSetService.java:79)
        at org.apache.solr.core.ConfigSetService.getConfig
(ConfigSetService.java:61)
        ... 9 more
Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in
classpath or '/var/lib/tomcat7/solr/collection1/conf'
        at org.apache.solr.core.SolrResourceLoader.openResource
(SolrResourceLoader.java:362)
        at org.apache.solr.core.SolrResourceLoader.openConfig
(SolrResourceLoader.java:308)
        at org.apache.solr.core.Config.<init>(Config.java:116)
        at org.apache.solr.core.Config.<init>(Config.java:86)
        at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:161)
        at org.apache.solr.core.SolrConfig.readFromResourceLoader
(SolrConfig.java:144)

When I try to define a docBase in
the /etc/tomcat7/Catalina/localhost/solr4.xml file catalina.out logs has
this:

WARNING: A docBase /var/lib/tomcat7/webapps/solr4/WEB-INF/lib inside the
host appBase has been specified, and will be ignored

With this in here as the entire file:

<?xml version='1.0' encoding='UTF-8'?>
<Context docBase="/var/lib/tomcat7/webapps/solr4/WEB-INF/lib/" debug="0"
crossContext="true">
  <Environment name="solr/home"        type="java.lang.String"
value="/data/alfresco_5.0.1/alf_data/solr4" override="true"/>
  <Environment name="solr/model/dir"   type="java.lang.String"
value="/data/alfresco_5.0.1/alf_data/solr4/alfrescoModels"
override="true"/>
</Context>

I get this in the catalina.out file:

INFO: Deploying configuration
descriptor /etc/tomcat7/Catalina/localhost/solr4.xml
Oct 09, 2015 8:53:41 AM org.apache.catalina.startup.HostConfig
deployDescriptor
WARNING: A docBase /var/lib/tomcat7/webapps/solr4/WEB-INF/lib inside the
host appBase has been specified, and will be ignored
Oct 09, 2015 8:53:41 AM
org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug' to
'0' did not find a matching property.
Oct 09, 2015 8:53:56 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
2015-10-09 08:53:58,048  ERROR [solr.core.CoreContainer]
[coreLoadExecutor-5-thread-1] Unable to create core: collection1
 org.apache.solr.common.SolrException: Could not load core configuration
for core collection1
        at org.apache.solr.core.ConfigSetService.getConfig
(ConfigSetService.java:66)
        at org.apache.solr.core.CoreContainer.create
(CoreContainer.java:554)
        at org.apache.solr.core.CoreContainer$1.call
(CoreContainer.java:261)
        at org.apache.solr.core.CoreContainer$1.call
(CoreContainer.java:253)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call
(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker
(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Error loading solr config
from /data/alfresco_5.0.1/alf_data/solr4/collection1/solrconfig.xml
        at org.apache.solr.core.SolrConfig.readFromResourceLoader
(SolrConfig.java:148)
        at org.apache.solr.core.ConfigSetService.createSolrConfig
(ConfigSetService.java:79)
        at org.apache.solr.core.ConfigSetService.getConfig
(ConfigSetService.java:61)
        ... 9 more
Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in
classpath or '/data/alfresco_5.0.1/alf_data/solr4/collection1/conf'
        at org.apache.solr.core.SolrResourceLoader.openResource
(SolrResourceLoader.java:362)
        at org.apache.solr.core.SolrResourceLoader.openConfig
(SolrResourceLoader.java:308)
        at org.apache.solr.core.Config.<init>(Config.java:116)
        at org.apache.solr.core.Config.<init>(Config.java:86)
        at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:161)
        at org.apache.solr.core.SolrConfig.readFromResourceLoader
(SolrConfig.java:144)
        ... 11 more
2015-10-09 08:53:58,064  ERROR [solr.core.CoreContainer]
[coreLoadExecutor-5-thread-1] null:org.apache.solr.common.SolrException:
Unable to create core: collection1
        at org.apache.solr.core.CoreContainer.recordAndThrow
(CoreContainer.java:911)
        at org.apache.solr.core.CoreContainer.create
(CoreContainer.java:568)
        at org.apache.solr.core.CoreContainer$1.call
(CoreContainer.java:261)
        at org.apache.solr.core.CoreContainer$1.call
(CoreContainer.java:253)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call
(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker
(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Could not load core
configuration for core collection1
        at org.apache.solr.core.ConfigSetService.getConfig
(ConfigSetService.java:66)
        at org.apache.solr.core.CoreContainer.create
(CoreContainer.java:554)
        ... 8 more
Caused by: org.apache.solr.common.SolrException: Error loading solr config
from /data/alfresco_5.0.1/alf_data/solr4/collection1/solrconfig.xml
        at org.apache.solr.core.SolrConfig.readFromResourceLoader
(SolrConfig.java:148)
        at org.apache.solr.core.ConfigSetService.createSolrConfig
(ConfigSetService.java:79)
        at org.apache.solr.core.ConfigSetService.getConfig
(ConfigSetService.java:61)
        ... 9 more
Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in
classpath or '/data/alfresco_5.0.1/alf_data/solr4/collection1/conf'
        at org.apache.solr.core.SolrResourceLoader.openResource
(SolrResourceLoader.java:362)
        at org.apache.solr.core.SolrResourceLoader.openConfig
(SolrResourceLoader.java:308)
        at org.apache.solr.core.Config.<init>(Config.java:116)
        at org.apache.solr.core.Config.<init>(Config.java:86)
        at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:161)
        at org.apache.solr.core.SolrConfig.readFromResourceLoader
(SolrConfig.java:144)

I know it's just getting the information in the same place.  Tomcat7 is the
owner and group for /data/alfresco_5.0.1/alf_data/solr4.

All help is appreciated.


Eric Speake
Senior Systems Administrator
Information Systems
O'Reilly Auto Parts
 (417) 862-2674  Ext. 1975

This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.

Re: How do I set up custom collection cores?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 10/12/2015 10:31 AM, espeake@oreillyauto.com wrote:
> WARNING: A docBase /var/lib/Tomcat7/webapps/solr4.war inside the host
> appBase has been specified, and will be ignored

That is a Tomcat configuration problem.

I googled to see what I could find.  It sounds to me like you have
specified both appBase and docBase in the Tomcat config that loads Solr,
and that one location is inside the other.  You might need to include
only one of them, or adjust locations so that they are in different places.

My experience with Tomcat is very limited.  If what I've said here
doesn't help you figure out the problem, then I would suggest enlisting
the help of the Tomcat project.

http://tomcat.apache.org/findhelp.html

Although there are people on this list that know a lot about Tomcat, as
of 5.0, Solr no longer officially supports deployment in third-party
containers.  With 4.x, we provide the .war file for deployment, but
every container is different, and the Solr project cannot help with
container configuration beyond simple questions about the Jetty that is
included with Solr.

Another option is migrating to Solr 5.x and using the startup scripts
provided in the download.  You would be using the Jetty that is
included, not Tomcat.

Thanks,
Shawn


Re: How do I set up custom collection cores?

Posted by es...@oreillyauto.com.



From:	Shawn Heisey <ap...@elyograg.org>
To:	solr-user@lucene.apache.org
Date:	10/09/2015 12:33 PM
Subject:	Re: How do I set up custom collection cores?



On 10/9/2015 10:03 AM, espeake@oreillyauto.com wrote:
> We are installing Alfresco One 5.0.1 with solr4 on a server that has an
> existing instance of tomcat7.  I am trying to find some better
> documentation on how to setup our cores.  In the solr4.xml located

<snip>

> Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in
> classpath or '/var/lib/tomcat7/solr/collection1/conf'
>         at org.apache.solr.core.SolrResourceLoader.openResource
> (SolrResourceLoader.java:362)
>         at org.apache.solr.core.SolrResourceLoader.openConfig
> (SolrResourceLoader.java:308)
>         at org.apache.solr.core.Config.<init>(Config.java:116)
>         at org.apache.solr.core.Config.<init>(Config.java:86)
>         at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:161)
>         at org.apache.solr.core.SolrConfig.readFromResourceLoader
> (SolrConfig.java:144)

Solr can't find the config for the collection1 core.

> When I try to define a docBase in
> the /etc/tomcat7/Catalina/localhost/solr4.xml file catalina.out logs has
> this:

It looks like docBase needs to point to the war file.  If you want to
change where Solr puts its data, you need to define either the
solr.solr.home java system property (on the java commandline --
-Dsolr.solr.home=/my/path) or the solr/home JNDI property.

The other parts of this are atleast moving me forward.  I added the
-Dsolr.solr.home=/data/alfresco_5.0.1/alf_data/solr4 to my Java startup and
I still get:

WARNING: A docBase /var/lib/tomcat7/webapps/solr4.war inside the host
appBase has been specified, and will be ignored

Should I point the solr.home to /var/lib/tomcat7/webapps/solr4 ?

https://wiki.apache.org/solr/SolrTomcat#Configuring_Solr_Home_with_JNDI

Exactly what file/directory layout you need is dependent on the precise
Solr version and whether your solr.xml file (not the solr4.xml you
mentioned -- that's for your container and is not used by solr) is in
the new or old format.  The solr.xml file lives in the solr home directory.

http://wiki.apache.org/solr/Solr.xml%204.4%20and%20beyond
https://wiki.apache.org/solr/Solr.xml%20%28supported%20through%204.x%29

Thanks,
Shawn



This communication and any attachments are confidential, protected by Communications Privacy Act 18 USCS � 2510, solely for the use of the intended recipient, and may contain legally privileged material. If you are not the intended recipient, please return or destroy it immediately. Thank you.

Re: How do I set up custom collection cores?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 10/9/2015 10:03 AM, espeake@oreillyauto.com wrote:
> We are installing Alfresco One 5.0.1 with solr4 on a server that has an
> existing instance of tomcat7.  I am trying to find some better
> documentation on how to setup our cores.  In the solr4.xml located

<snip>

> Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in
> classpath or '/var/lib/tomcat7/solr/collection1/conf'
>         at org.apache.solr.core.SolrResourceLoader.openResource
> (SolrResourceLoader.java:362)
>         at org.apache.solr.core.SolrResourceLoader.openConfig
> (SolrResourceLoader.java:308)
>         at org.apache.solr.core.Config.<init>(Config.java:116)
>         at org.apache.solr.core.Config.<init>(Config.java:86)
>         at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:161)
>         at org.apache.solr.core.SolrConfig.readFromResourceLoader
> (SolrConfig.java:144)

Solr can't find the config for the collection1 core.

> When I try to define a docBase in
> the /etc/tomcat7/Catalina/localhost/solr4.xml file catalina.out logs has
> this:

It looks like docBase needs to point to the war file.  If you want to
change where Solr puts its data, you need to define either the
solr.solr.home java system property (on the java commandline --
-Dsolr.solr.home=/my/path) or the solr/home JNDI property.

https://wiki.apache.org/solr/SolrTomcat#Configuring_Solr_Home_with_JNDI

Exactly what file/directory layout you need is dependent on the precise
Solr version and whether your solr.xml file (not the solr4.xml you
mentioned -- that's for your container and is not used by solr) is in
the new or old format.  The solr.xml file lives in the solr home directory.

http://wiki.apache.org/solr/Solr.xml%204.4%20and%20beyond
https://wiki.apache.org/solr/Solr.xml%20%28supported%20through%204.x%29

Thanks,
Shawn