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 Paul <pa...@nines.org> on 2012/09/04 20:50:27 UTC
Setting up two cores in solr.xml for Solr 4.0
I'm trying to set up two cores that share everything except their
data. (This is for testing: I want to create a parallel index that is
used when running my testing scripts.) I thought that would be
straightforward, and according to the documentation, I thought the
following would work:
<cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
<core name="MYCORE" instanceDir="MYCORE" />
<core name="MYCORE_test" instanceDir="MYCORE">
<property name="dataDir" value="MYCORE_test" />
</core>
</cores>
I thought that would create a directory structure like this:
solr
MYCORE
conf
data
index
MYCORE_test
index
But it looks like both of the cores are sharing the same index and the
MYCORE_test directory is not created. In addition, I get the followin
in the log file:
INFO: [MYCORE_test] Opening new SolrCore at solr/MYCORE/,
dataDir=solr/MYCORE/data/
...
WARNING: New index directory detected: old=null new=solr/MYCORE/data/index/
What am I not understanding?
Re: Setting up two cores in solr.xml for Solr 4.0
Posted by veena rani <ve...@gmail.com>.
<cores adminPath="/admin/cores">
<core name="core0" instanceDir="core0" />
<core name="core1" instanceDir="core1" />
</cores>
try the above code snippet , in solr.xml.
But it works on Tomcat.
On Wed, Sep 5, 2012 at 1:10 AM, Chris Hostetter <ho...@fucit.org>wrote:
>
> : <core name="MYCORE_test" instanceDir="MYCORE" dataDir="MYCORE_test" />
>
> I'm pretty sure what you hav above tells solr that core MYCORE_test it
> should use the instanceDir MYCORE but ignore the <dataDir/> in that
> solrconfig.xml and use the one you specified.
>
> This on the other hand...
>
> : > <core name="MYCORE_test" instanceDir="MYCORE">
> : > <property name="dataDir" value="MYCORE_test" />
> : > </core>
>
> ...tells solr that the MYCORE_test SolrCore should use the instanceDir
> MYCORE, and when parsing that solrconfig.xml file it should set the
> variable ${dataDir} to be "MYCORE_test" -- but if your solconfig.xml file
> does not ever refer to the ${dataDir} variable, it would have any effect.
>
> so the question becomes -- what does your solrconfig.xml look like?
>
>
> -Hoss
>
--
Regards,
Veena.
Banglore.
Re: Setting up two cores in solr.xml for Solr 4.0
Posted by Chris Hostetter <ho...@fucit.org>.
: I don't think I changed by solrconfig.xml file from the default that
: was provided in the example folder for solr 4.0.
ok ... well the Solr 4.0-BETA example solrconfig.xml has this in it...
<dataDir>${solr.data.dir:}</dataDir>
So if you want to override the dataDir using a "property" like your second
example, it should be something like...
<core name="MYCORE_test" instanceDir="MYCORE">
<property name="solr.data.dir" value="MYCORE_test" />
</core>
...the property name used in the solrconfig.xml has to match the property
name you use when declaring the core, or it won't get used and you'll get
the default behavior. "solr.data.dir" isn't special here -- you could use
any umber of properties in your solrconfig.xml, and declare them when
defining your individual cores.
that's very differnet from your other example...
<core name="MYCORE_test" instanceDir="MYCORE" dataDir="MYCORE_test" />
...which doesn't use properties at all, and says "this is waht the dataDir
should be, regardless of what the <dataDir>...</dataDir> looks like in the
solrconfig.xml
(at least: i'm pretty sure that's how it works)
-Hoss
Re: Setting up two cores in solr.xml for Solr 4.0
Posted by Paul <pa...@nines.org>.
I don't think I changed by solrconfig.xml file from the default that
was provided in the example folder for solr 4.0.
On Tue, Sep 4, 2012 at 3:40 PM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : <core name="MYCORE_test" instanceDir="MYCORE" dataDir="MYCORE_test" />
>
> I'm pretty sure what you hav above tells solr that core MYCORE_test it
> should use the instanceDir MYCORE but ignore the <dataDir/> in that
> solrconfig.xml and use the one you specified.
>
> This on the other hand...
>
> : > <core name="MYCORE_test" instanceDir="MYCORE">
> : > <property name="dataDir" value="MYCORE_test" />
> : > </core>
>
> ...tells solr that the MYCORE_test SolrCore should use the instanceDir
> MYCORE, and when parsing that solrconfig.xml file it should set the
> variable ${dataDir} to be "MYCORE_test" -- but if your solconfig.xml file
> does not ever refer to the ${dataDir} variable, it would have any effect.
>
> so the question becomes -- what does your solrconfig.xml look like?
>
>
> -Hoss
Re: Setting up two cores in solr.xml for Solr 4.0
Posted by Chris Hostetter <ho...@fucit.org>.
: <core name="MYCORE_test" instanceDir="MYCORE" dataDir="MYCORE_test" />
I'm pretty sure what you hav above tells solr that core MYCORE_test it
should use the instanceDir MYCORE but ignore the <dataDir/> in that
solrconfig.xml and use the one you specified.
This on the other hand...
: > <core name="MYCORE_test" instanceDir="MYCORE">
: > <property name="dataDir" value="MYCORE_test" />
: > </core>
...tells solr that the MYCORE_test SolrCore should use the instanceDir
MYCORE, and when parsing that solrconfig.xml file it should set the
variable ${dataDir} to be "MYCORE_test" -- but if your solconfig.xml file
does not ever refer to the ${dataDir} variable, it would have any effect.
so the question becomes -- what does your solrconfig.xml look like?
-Hoss
Re: Setting up two cores in solr.xml for Solr 4.0
Posted by Mark Miller <ma...@gmail.com>.
Sounds weird. It's just parsing xml with an xml parser, so offhand, I
don't see why that should matter.
On Tue, Sep 4, 2012 at 3:09 PM, Paul <pa...@nines.org> wrote:
> By trial an error, I found that you evidently need to put that
> property inline, so this version works:
>
> <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
> <core name="MYCORE" instanceDir="MYCORE" />
> <core name="MYCORE_test" instanceDir="MYCORE" dataDir="MYCORE_test" />
> </cores>
>
> Is the documentation here in error? http://wiki.apache.org/solr/CoreAdmin
>
> On Tue, Sep 4, 2012 at 2:50 PM, Paul <pa...@nines.org> wrote:
>> I'm trying to set up two cores that share everything except their
>> data. (This is for testing: I want to create a parallel index that is
>> used when running my testing scripts.) I thought that would be
>> straightforward, and according to the documentation, I thought the
>> following would work:
>>
>> <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
>> <core name="MYCORE" instanceDir="MYCORE" />
>> <core name="MYCORE_test" instanceDir="MYCORE">
>> <property name="dataDir" value="MYCORE_test" />
>> </core>
>> </cores>
>>
>> I thought that would create a directory structure like this:
>>
>> solr
>> MYCORE
>> conf
>> data
>> index
>> MYCORE_test
>> index
>>
>> But it looks like both of the cores are sharing the same index and the
>> MYCORE_test directory is not created. In addition, I get the followin
>> in the log file:
>>
>> INFO: [MYCORE_test] Opening new SolrCore at solr/MYCORE/,
>> dataDir=solr/MYCORE/data/
>> ...
>> WARNING: New index directory detected: old=null new=solr/MYCORE/data/index/
>>
>> What am I not understanding?
--
- Mark
Re: Setting up two cores in solr.xml for Solr 4.0
Posted by Paul <pa...@nines.org>.
By trial an error, I found that you evidently need to put that
property inline, so this version works:
<cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
<core name="MYCORE" instanceDir="MYCORE" />
<core name="MYCORE_test" instanceDir="MYCORE" dataDir="MYCORE_test" />
</cores>
Is the documentation here in error? http://wiki.apache.org/solr/CoreAdmin
On Tue, Sep 4, 2012 at 2:50 PM, Paul <pa...@nines.org> wrote:
> I'm trying to set up two cores that share everything except their
> data. (This is for testing: I want to create a parallel index that is
> used when running my testing scripts.) I thought that would be
> straightforward, and according to the documentation, I thought the
> following would work:
>
> <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
> <core name="MYCORE" instanceDir="MYCORE" />
> <core name="MYCORE_test" instanceDir="MYCORE">
> <property name="dataDir" value="MYCORE_test" />
> </core>
> </cores>
>
> I thought that would create a directory structure like this:
>
> solr
> MYCORE
> conf
> data
> index
> MYCORE_test
> index
>
> But it looks like both of the cores are sharing the same index and the
> MYCORE_test directory is not created. In addition, I get the followin
> in the log file:
>
> INFO: [MYCORE_test] Opening new SolrCore at solr/MYCORE/,
> dataDir=solr/MYCORE/data/
> ...
> WARNING: New index directory detected: old=null new=solr/MYCORE/data/index/
>
> What am I not understanding?