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 Zach Friedland <wa...@yahoo.com> on 2011/01/08 19:53:01 UTC
multicore controlled by properties
We have a large number of solr cores that are used by different groups for
different purposes. To make the source control simple, we keep a single
'multicore' directory and solr.xml references all cores. We deploy the same
configuration to all servers (shared NFS mount), and then only populate the
indexes of the cores that we want running on that server. However, it still
seems wasteful to have the cores running where we know they won't be used. What
I'd like to be able to do is define properties that will allow me to enable and
disable cores via JVM params on startup. I was hoping to use the 'enable'
parameter that is supported elsewhere in solr, but it didn't seem to be
respected in solr.xml. Here's the syntax I tried in my solr.xml file:
<cores adminPath="/admin/cores">
<core name="businessUnit1" instanceDir="businessUnit1"
enable="${solr.enable.core.businessUnit1:true}"/>
<core name="businessUnit2" instanceDir="businessUnit2"
enable="${solr.enable.core.businessUnit2:true}"/>
<core name="businessUnit3" instanceDir="businessUnit3"
enable="${solr.enable.core.businessUnit3:true}"/>
<core name="businessUnit4" instanceDir="businessUnit4"
enable="${solr.enable.core.businessUnit4:true}"/>
<core name="businessUnit5" instanceDir="businessUnit5"
enable="${solr.enable.core.businessUnit5:true}"/>
</cores>
Another idea is that I have solr1.xml, solr2.xml, solr3.xml, solr4.xml (etc);
and then have some property that tells the JVM which solr.xml version to load
(and each xml file would have only the cores that that instance needs). But I
couldn't find any property that controls which xml file is loaded for
multicore. Is the code hard-coded to look for solr.xml?
Thanks
RE: multicore controlled by properties
Posted by Ephraim Ofir <Ep...@icq.com>.
I use a script to generate the appropriate solr.xml for each host according to a config file. You could also prepare separate files and create a soft link from solr.xml to the appropriate one on each host.
Ephraim Ofir
-----Original Message-----
From: Lance Norskog [mailto:goksron@gmail.com]
Sent: Sunday, January 09, 2011 6:03 AM
To: solr-user@lucene.apache.org; Zach Friedland
Subject: Re: multicore controlled by properties
The config files support XInclude. Some sites use this to include a
local configuration that affects your single global file.
On Sat, Jan 8, 2011 at 10:53 AM, Zach Friedland <wa...@yahoo.com> wrote:
> We have a large number of solr cores that are used by different groups for
> different purposes. To make the source control simple, we keep a single
> 'multicore' directory and solr.xml references all cores. We deploy the same
> configuration to all servers (shared NFS mount), and then only populate the
> indexes of the cores that we want running on that server. However, it still
> seems wasteful to have the cores running where we know they won't be used. What
> I'd like to be able to do is define properties that will allow me to enable and
> disable cores via JVM params on startup. I was hoping to use the 'enable'
> parameter that is supported elsewhere in solr, but it didn't seem to be
> respected in solr.xml. Here's the syntax I tried in my solr.xml file:
>
> <cores adminPath="/admin/cores">
> <core name="businessUnit1" instanceDir="businessUnit1"
> enable="${solr.enable.core.businessUnit1:true}"/>
> <core name="businessUnit2" instanceDir="businessUnit2"
> enable="${solr.enable.core.businessUnit2:true}"/>
> <core name="businessUnit3" instanceDir="businessUnit3"
> enable="${solr.enable.core.businessUnit3:true}"/>
> <core name="businessUnit4" instanceDir="businessUnit4"
> enable="${solr.enable.core.businessUnit4:true}"/>
> <core name="businessUnit5" instanceDir="businessUnit5"
> enable="${solr.enable.core.businessUnit5:true}"/>
> </cores>
>
> Another idea is that I have solr1.xml, solr2.xml, solr3.xml, solr4.xml (etc);
> and then have some property that tells the JVM which solr.xml version to load
> (and each xml file would have only the cores that that instance needs). But I
> couldn't find any property that controls which xml file is loaded for
> multicore. Is the code hard-coded to look for solr.xml?
>
> Thanks
>
>
>
>
>
--
Lance Norskog
goksron@gmail.com
Re: multicore controlled by properties
Posted by Lance Norskog <go...@gmail.com>.
The config files support XInclude. Some sites use this to include a
local configuration that affects your single global file.
On Sat, Jan 8, 2011 at 10:53 AM, Zach Friedland <wa...@yahoo.com> wrote:
> We have a large number of solr cores that are used by different groups for
> different purposes. To make the source control simple, we keep a single
> 'multicore' directory and solr.xml references all cores. We deploy the same
> configuration to all servers (shared NFS mount), and then only populate the
> indexes of the cores that we want running on that server. However, it still
> seems wasteful to have the cores running where we know they won't be used. What
> I'd like to be able to do is define properties that will allow me to enable and
> disable cores via JVM params on startup. I was hoping to use the 'enable'
> parameter that is supported elsewhere in solr, but it didn't seem to be
> respected in solr.xml. Here's the syntax I tried in my solr.xml file:
>
> <cores adminPath="/admin/cores">
> <core name="businessUnit1" instanceDir="businessUnit1"
> enable="${solr.enable.core.businessUnit1:true}"/>
> <core name="businessUnit2" instanceDir="businessUnit2"
> enable="${solr.enable.core.businessUnit2:true}"/>
> <core name="businessUnit3" instanceDir="businessUnit3"
> enable="${solr.enable.core.businessUnit3:true}"/>
> <core name="businessUnit4" instanceDir="businessUnit4"
> enable="${solr.enable.core.businessUnit4:true}"/>
> <core name="businessUnit5" instanceDir="businessUnit5"
> enable="${solr.enable.core.businessUnit5:true}"/>
> </cores>
>
> Another idea is that I have solr1.xml, solr2.xml, solr3.xml, solr4.xml (etc);
> and then have some property that tells the JVM which solr.xml version to load
> (and each xml file would have only the cores that that instance needs). But I
> couldn't find any property that controls which xml file is loaded for
> multicore. Is the code hard-coded to look for solr.xml?
>
> Thanks
>
>
>
>
>
--
Lance Norskog
goksron@gmail.com