views:

846

answers:

1

I have spend all morning trying to set up multiple cores on a SOLR installation that runs under Apache Tomcat server without success. My solr.xml looks like this:

<solr persistent="false" sharedLib="lib">
  <cores adminPath="/admin/cores">
    <core name="core0" instanceDir="/multicore/core0">   
        <property name="dataDir" value="/multicore/core0/data" />
    </core>
    <core name="core1" instanceDir="/multicore/core1">
        <property name="dataDir" value="/multicore/core1/data" />
    </core>
  </cores>
</solr>

What is the correct directory structure? Do I need to do change something in the solrconfig.xml?

+1  A: 

Check that your instanceDir values are relative to -Dsolr.solr.home. If -Dsolr.solr.home is 'multicore', then your instanceDir should be only "core0".

If you put your data folder inside your instanceDir, you should not have to specify its path:

<?xml version='1.0' encoding='UTF-8'?>
<solr persistent="true">
<cores adminPath="/admin/cores">
    <core name="core0" instanceDir="core0" />
    <core name="core1" instanceDir="core1" />
</cores>
</solr>

You should not have to set anything in solrconfig.xml. But if you need to configure an handler independantly of the core location, you can use the variable ${solr.core.instanceDir}.

UPDATE

To set the solr.solr.home variable with Tomcat, use the JAVA_OPTS environment variable before starting Tomcat:

JAVA_OPTS="-Dsolr.solr.home=multicore"
export JAVA_OPTS
tomcat/bin/catalina.sh start

Make sure that "multicore" is correctly set relative to the working directory. Per example, if solr.solr.home='multicore', you have to launch Tomcat from the directory where "multicore" is located.

Pascal Dimassimo
Thanks for the fast answeer Pascal. How can I check what my solr.solr.home is? I'm running solr on Tomcat and not Jetty so cannot set that on the command line when running the start.jar.I tries the above solr.xml but still get the following error when trying to visit http://devel:12345/solr/core0/admin/type Status reportmessage /solr/core0/admin/description The requested resource (/solr/core0/admin/) is not available.Any ideas what might be it?
Sfairas
With Tomcat, you can use the environment variable JAVA_OPTS to set -Dsolr.solr.home before calling the catalina script.
Pascal Dimassimo
OK I set the JAVA_OPTS='-Dsolr.solr.home=multicore' but still cannot get it to work. I know that it's a configuration issue but I just can't figure out what I'm missing here.
Sfairas
see the updates to my answer
Pascal Dimassimo