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 Jonathan Rochkind <ro...@jhu.edu> on 2011/03/01 00:00:06 UTC

multi-core solr, specifying the data directory

Unless I'm doing something wrong, in my experience in multi-core Solr in 
1.4.1, you NEED to explicitly provide an absolute path to the 'data' dir.

I set up multi-core like this:

<cores adminPath="/admin/cores">
<core name="some_core" instanceDir="some_core">
</core>
</cores>


Now, setting instanceDir like that works for Solr to look for the 'conf' 
directory in the default location you'd expect, ./some_core/conf.

You'd expect it to look for the 'data' dir for an index in 
./some_core/data too, by default.  But it does not seem to. It's still 
looking for the 'data' directory in the _main_ solr.home/data, not under 
the relevant core directory.

The only way I can manage to get it to look for the /data directory 
where I expect is to spell it out with a full absolute path:

<core name="some_core" instanceDir="some_core">
<property name="dataDir" value="/path/to/main/solr/some_core/data" />
</core>

And then in the solrconfig.xml do a <dataDir>${dataDir}</dataDir>

Is this what everyone else does too? Or am I missing a better way of 
doing this?  I would have thought it would "just work", with Solr by 
default looking for a ./data subdir of the specified instanceDir.  But 
it definitely doesn't seem to do that.

Should it? Anyone know if Solr in trunk past 1.4.1 has been changed to 
do what I expect? Or am I wrong to expect it? Or does everyone else do 
multi-core in some different way than me where this doesn't come up?

Jonathan


Re: multi-core solr, specifying the data directory

Posted by Chris Hostetter <ho...@fucit.org>.
: I wonder if what doesn't work is trying to set an explicit relative path
: there, instead of using the baked in default "data".  If you set an explicit
: relative path, is it relative to the current core solr.home, or to the main
: solr.home?

it's realtive the current working dir of the process.

: Is _that_ a bug?

it's more an artifact of evolution -- it's just always worked that way, 
and changing it now would be a pretty nasty break for existing users.

if people are interested in helping to fix this, my vote would be to see a 
patch that let you include an optional 'rel' attribute on the data dir to 
say what you wnat the path to be relative to...

  <dataDir rel="solrHome">foo</dataDir>
  <dataDir rel="instanceDir">foo</dataDir>
  <dataDir rel="cwd">foo</dataDir> <!-- default, current behavior -->

typically people either use the default, or want a specific path outside 
of the solr home altogether (ie: on a completley differnet partion) and 
just use an absolute path, so it doesn't wind up being a big burden.

The biggest issue was the one that's already been mentioned: for a 
while the main example solrconfig.xml was using...

  <dataDir>${solr.data.dir:./data}</dataDir>

...instead of...

  <dataDir>${solr.data.dir:}</dataDir>

...meaning that the dataDir defaulted to "./data" (relative the CWD) 
instead of "" (which tells Solr to use it's own default in the 
instanceDir)  but this has been fixed for 3.x


-Hoss

Re: multi-core solr, specifying the data directory

Posted by Jonathan Rochkind <ro...@jhu.edu>.
I wonder if what doesn't work is trying to set an explicit relative path 
there, instead of using the baked in default "data".  If you set an 
explicit relative path, is it relative to the current core solr.home, or 
to the main solr.home?

Let's try it to see.... Yep, THAT's what doesn't work, and probably what 
I was trying to do before.

In solrconfig.xml for a core, I do <dataDir>data</dataDir>.

I expected that would be interpreted relative to current core solr.home, 
but it is, judging by the log files, instead based on the 'main' 
solr.home (above the cores, where the solr.xml is) -- or maybe even on 
some other value, the tomcat base url or something?

Is _that_ a bug?

On 3/2/2011 3:38 PM, Jonathan Rochkind wrote:
> Meanwhile, I'm having trouble getting the expected behavior at all. I'll
> try to give the right details (without overwhelming with too many), if
> anyone can see what's going on.
>
> Solr 1.4.1. Multi-core. 'Main' solr home with solr.xml at
> /opt/solr/solr_indexer/solr.xml
>
> The solr.xml includes actually only one core, let's start out nice and
> simple:
>
> <cores adminPath="/admin/cores">
> <core name="master_prod" instanceDir="master_prod">
> <property name="enable.master" value="true" />
> </core>
> </cores>
>
> [The enable.master thing is a custom property my solrconfig.xml uses in
> places unrelated to dataDir]
>
> 1. First try, the  solrconfig at
> /opt/solr/solr_indexer/master_prod/conf/solrconfig.xml includes NO
> dataDir element at all.
>
> WOAH. It just worked. Go figure. I don't know what I tried differently
> before, maybe Mike is right that people (including me) get confused by
> the<dataDir>  element being there, and needing to delete it entirely to
> get that default behavior.
>
> So anyway.... yeah. Sorry, thanks, appears to be working, although
> possibly confusing for the newbie to set up for reasons that aren't
> entirely clear, since several of us in this thread had trouble getting
> it right.
>
> On 3/2/2011 2:42 PM, Mike Sokolov wrote:
>> Yes - I commented out the<dataDir>   element in solrconfig.xml and then
>> got the expected behavior: the core used a data subdirectory in the core
>> subdirectory.
>>
>> It seems like the problem arises from using the solrconfig.xml that's
>> distributed as example/solr/conf/solrconfig.xml
>>
>> The solrconfig.xml's in  example/multicore/ don't have the<dataDir>
>> element.
>>
>> -Mike
>>
>> On 03/01/2011 08:24 PM, Chris Hostetter wrote:
>>> :<!-- Used to specify an alternate directory to hold all index data
>>> :        other than the default ./data under the Solr home.
>>> :        If replication is in use, this should match the replication
>>> : configuration
>>> : . -->
>>> :<dataDir>${solr.data.dir:./solr/data}</dataDir>
>>>
>>> that directive says "use the solr.data.dir system property to pick a path,
>>> if it is not set, use "./solr/data" (realtive the CWD)
>>>
>>> if you want it to use the default, then you need to eliminate it
>>> completley, or you need to change it to the empty string...
>>>
>>>       <dataDir>${solr.data.dir:}</dataDir>
>>>
>>> or...
>>>
>>>       <dataDir></dataDir>
>>>
>>>
>>> -Hoss
>>>

Re: multi-core solr, specifying the data directory

Posted by Jonathan Rochkind <ro...@jhu.edu>.
Meanwhile, I'm having trouble getting the expected behavior at all. I'll 
try to give the right details (without overwhelming with too many), if 
anyone can see what's going on.

Solr 1.4.1. Multi-core. 'Main' solr home with solr.xml at 
/opt/solr/solr_indexer/solr.xml

The solr.xml includes actually only one core, let's start out nice and 
simple:

<cores adminPath="/admin/cores">
<core name="master_prod" instanceDir="master_prod">
<property name="enable.master" value="true" />
</core>
</cores>

[The enable.master thing is a custom property my solrconfig.xml uses in 
places unrelated to dataDir]

1. First try, the  solrconfig at 
/opt/solr/solr_indexer/master_prod/conf/solrconfig.xml includes NO 
dataDir element at all.

WOAH. It just worked. Go figure. I don't know what I tried differently 
before, maybe Mike is right that people (including me) get confused by 
the <dataDir> element being there, and needing to delete it entirely to 
get that default behavior.

So anyway.... yeah. Sorry, thanks, appears to be working, although 
possibly confusing for the newbie to set up for reasons that aren't 
entirely clear, since several of us in this thread had trouble getting 
it right.

On 3/2/2011 2:42 PM, Mike Sokolov wrote:
> Yes - I commented out the<dataDir>  element in solrconfig.xml and then
> got the expected behavior: the core used a data subdirectory in the core
> subdirectory.
>
> It seems like the problem arises from using the solrconfig.xml that's
> distributed as example/solr/conf/solrconfig.xml
>
> The solrconfig.xml's in  example/multicore/ don't have the<dataDir>
> element.
>
> -Mike
>
> On 03/01/2011 08:24 PM, Chris Hostetter wrote:
>> :<!-- Used to specify an alternate directory to hold all index data
>> :        other than the default ./data under the Solr home.
>> :        If replication is in use, this should match the replication
>> : configuration
>> : . -->
>> :<dataDir>${solr.data.dir:./solr/data}</dataDir>
>>
>> that directive says "use the solr.data.dir system property to pick a path,
>> if it is not set, use "./solr/data" (realtive the CWD)
>>
>> if you want it to use the default, then you need to eliminate it
>> completley, or you need to change it to the empty string...
>>
>>      <dataDir>${solr.data.dir:}</dataDir>
>>
>> or...
>>
>>      <dataDir></dataDir>
>>
>>
>> -Hoss
>>

Re: multi-core solr, specifying the data directory

Posted by Mike Sokolov <so...@ifactory.com>.
Yes - I commented out the <dataDir> element in solrconfig.xml and then 
got the expected behavior: the core used a data subdirectory in the core 
subdirectory.

It seems like the problem arises from using the solrconfig.xml that's 
distributed as example/solr/conf/solrconfig.xml

The solrconfig.xml's in  example/multicore/ don't have the <dataDir> 
element.

-Mike

On 03/01/2011 08:24 PM, Chris Hostetter wrote:
> :<!-- Used to specify an alternate directory to hold all index data
> :        other than the default ./data under the Solr home.
> :        If replication is in use, this should match the replication
> : configuration
> : . -->
> :<dataDir>${solr.data.dir:./solr/data}</dataDir>
>
> that directive says "use the solr.data.dir system property to pick a path,
> if it is not set, use "./solr/data" (realtive the CWD)
>
> if you want it to use the default, then you need to eliminate it
> completley, or you need to change it to the empty string...
>
>     <dataDir>${solr.data.dir:}</dataDir>
>
> or...
>
>     <dataDir></dataDir>
>
>
> -Hoss
>    

Re: multi-core solr, specifying the data directory

Posted by Chris Hostetter <ho...@fucit.org>.
: <!-- Used to specify an alternate directory to hold all index data
:        other than the default ./data under the Solr home.
:        If replication is in use, this should match the replication
: configuration
: . -->
: <dataDir>${solr.data.dir:./solr/data}</dataDir>

that directive says "use the solr.data.dir system property to pick a path, 
if it is not set, use "./solr/data" (realtive the CWD)

if you want it to use the default, then you need to eliminate it 
completley, or you need to change it to the empty string...

   <dataDir>${solr.data.dir:}</dataDir>

or...

   <dataDir></dataDir>


-Hoss

Re: multi-core solr, specifying the data directory

Posted by Jonathan Rochkind <ro...@jhu.edu>.
This definitely matches my own experience, and I've heard it from 
others. I haven't heard of anyone who HAS gotten it to work like that.  
But apparently there's a distributed multi-core example which claims to 
work like it doesn't for us.

One of us has to try the Solr distro multi-core example, as Hoss 
suggested/asked, to see if the problem exhibits even there, and if not, 
figure out what the difference is.  Sorry, haven't found time to figure 
out how to install and start up the demo.

I am running in Tomcat, I wonder if container could matter, and maybe it 
somehow works in Jetty or something?

Jonathan


On 3/1/2011 7:05 PM, Michael Sokolov wrote:
> I tried this in my 1.4.0 installation (commenting out what had been
> working, hoping the default would be as you said works in the example):
>
> <solr persistent="true" sharedLib="lib">
> <cores adminPath="/admin/cores">
> <core name="bpro" instanceDir="bpro">
> <!--<property name="solr.data.dir" value="solr/bpro/data"/>  -->
> </core>
> <core name="pfapp" instanceDir="pfapp">
> <property name="solr.data.dir" value="solr/pfapp/data"/>
> </core>
> </cores>
> </solr>
>
> In the log after starting up, I get these messages (among many others):
>
> ...
>
> Mar 1, 2011 7:51:23 PM org.apache.solr.core.CoreContainer$Initializer
> initialize
> INFO: looking for solr.xml: /usr/local/tomcat/solr/solr.xml
> Mar 1, 2011 7:51:23 PM org.apache.solr.core.SolrResourceLoader
> locateSolrHome
> INFO: No /solr/home in JNDI
> Mar 1, 2011 7:51:23 PM org.apache.solr.core.SolrResourceLoader
> locateSolrHome
> INFO: solr home defaulted to 'solr/' (could not find system property or
> JNDI)
> Mar 1, 2011 7:51:23 PM org.apache.solr.core.SolrResourceLoader<init>
> INFO: Solr home set to 'solr/'
>
> Mar 1, 2011 7:51:23 PM org.apache.solr.core.SolrResourceLoader<init>
> INFO: Solr home set to 'solr/bpro/'
> ...
> Mar 1, 2011 7:51:24 PM org.apache.solr.core.SolrCore<init>
> INFO: [bpro] Opening new SolrCore at solr/bpro/, dataDir=./solr/data/
> ...
> Mar 1, 2011 7:51:25 PM org.apache.solr.core.SolrResourceLoader<init>
> INFO: Solr home set to 'solr/pfapp/'
> ...
> Mar 1, 2011 7:51:26 PM org.apache.solr.core.SolrCore<init>
> INFO: [pfapp] Opening new SolrCore at solr/pfapp/, dataDir=solr/pfapp/data/
>
> and it's pretty clearly using the "wrong" directory at that point.
>
> Some more details:
>
> /usr/local/tomcat has the usual tomcat distribution (this is 6.0.29)
> conf/server.xml has:
> <Host name="localhost"  appBase="webapps"
>               unpackWARs="true" autoDeploy="true"
>               xmlValidation="false" xmlNamespaceAware="false">
>
> <Alias>rosen</Alias>
> <Alias>rosen.ifactory.com</Alias>
> <Context path="" docBase="/usr/local/tomcat/webapps/solr" />
>
> </Host>
>
> There is a solrconfig.xml in each of the core directories (should there
> only be one of these?).  I believe these are pretty generic (and they
> are identical); the one in the bpro folder has:
>
> <!-- Used to specify an alternate directory to hold all index data
>          other than the default ./data under the Solr home.
>          If replication is in use, this should match the replication
> configuration
> . -->
> <dataDir>${solr.data.dir:./solr/data}</dataDir>
>
>
>
> -Mike
>
> On 3/1/2011 4:38 PM, Jonathan Rochkind wrote:
>> Hmm, okay, have to try to find time to install the example/multicore
>> and see.
>>
>> It's definitely never worked for me, weird.
>>
>> Thanks.
>>
>> On 3/1/2011 2:38 PM, Chris Hostetter wrote:
>>> : Unless I'm doing something wrong, in my experience in multi-core
>>> Solr in
>>> : 1.4.1, you NEED to explicitly provide an absolute path to the
>>> 'data' dir.
>>>
>>> have you looked at the example/multicore directory that was included in
>>> the 1.4.1 release?
>>>
>>> it has a solr.xml that loads two cores w/o specifying a data dir in the
>>> solr.xml (or hte solrconfig.xml) and it uses the "data" dir inside the
>>> specified instanceDir.
>>>
>>> If that example works for you, but your own configs do not, then we'll
>>> need more details about your own configs -- how are you running solr,
>>> what
>>> does the solrconfig.xml of the core look like, etc...
>>>
>>>
>>> -Hoss
>>>
>

Re: multi-core solr, specifying the data directory

Posted by Michael Sokolov <so...@ifactory.com>.
I tried this in my 1.4.0 installation (commenting out what had been 
working, hoping the default would be as you said works in the example):

<solr persistent="true" sharedLib="lib">
<cores adminPath="/admin/cores">
<core name="bpro" instanceDir="bpro">
<!-- <property name="solr.data.dir" value="solr/bpro/data"/> -->
</core>
<core name="pfapp" instanceDir="pfapp">
<property name="solr.data.dir" value="solr/pfapp/data"/>
</core>
</cores>
</solr>

In the log after starting up, I get these messages (among many others):

...

Mar 1, 2011 7:51:23 PM org.apache.solr.core.CoreContainer$Initializer 
initialize
INFO: looking for solr.xml: /usr/local/tomcat/solr/solr.xml
Mar 1, 2011 7:51:23 PM org.apache.solr.core.SolrResourceLoader 
locateSolrHome
INFO: No /solr/home in JNDI
Mar 1, 2011 7:51:23 PM org.apache.solr.core.SolrResourceLoader 
locateSolrHome
INFO: solr home defaulted to 'solr/' (could not find system property or 
JNDI)
Mar 1, 2011 7:51:23 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to 'solr/'

Mar 1, 2011 7:51:23 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to 'solr/bpro/'
...
Mar 1, 2011 7:51:24 PM org.apache.solr.core.SolrCore <init>
INFO: [bpro] Opening new SolrCore at solr/bpro/, dataDir=./solr/data/
...
Mar 1, 2011 7:51:25 PM org.apache.solr.core.SolrResourceLoader <init>
INFO: Solr home set to 'solr/pfapp/'
...
Mar 1, 2011 7:51:26 PM org.apache.solr.core.SolrCore <init>
INFO: [pfapp] Opening new SolrCore at solr/pfapp/, dataDir=solr/pfapp/data/

and it's pretty clearly using the "wrong" directory at that point.

Some more details:

/usr/local/tomcat has the usual tomcat distribution (this is 6.0.29)
conf/server.xml has:
<Host name="localhost"  appBase="webapps"
             unpackWARs="true" autoDeploy="true"
             xmlValidation="false" xmlNamespaceAware="false">

<Alias>rosen</Alias>
<Alias>rosen.ifactory.com</Alias>
<Context path="" docBase="/usr/local/tomcat/webapps/solr" />

</Host>

There is a solrconfig.xml in each of the core directories (should there 
only be one of these?).  I believe these are pretty generic (and they 
are identical); the one in the bpro folder has:

<!-- Used to specify an alternate directory to hold all index data
        other than the default ./data under the Solr home.
        If replication is in use, this should match the replication 
configuration
. -->
<dataDir>${solr.data.dir:./solr/data}</dataDir>



-Mike

On 3/1/2011 4:38 PM, Jonathan Rochkind wrote:
> Hmm, okay, have to try to find time to install the example/multicore 
> and see.
>
> It's definitely never worked for me, weird.
>
> Thanks.
>
> On 3/1/2011 2:38 PM, Chris Hostetter wrote:
>> : Unless I'm doing something wrong, in my experience in multi-core 
>> Solr in
>> : 1.4.1, you NEED to explicitly provide an absolute path to the 
>> 'data' dir.
>>
>> have you looked at the example/multicore directory that was included in
>> the 1.4.1 release?
>>
>> it has a solr.xml that loads two cores w/o specifying a data dir in the
>> solr.xml (or hte solrconfig.xml) and it uses the "data" dir inside the
>> specified instanceDir.
>>
>> If that example works for you, but your own configs do not, then we'll
>> need more details about your own configs -- how are you running solr, 
>> what
>> does the solrconfig.xml of the core look like, etc...
>>
>>
>> -Hoss
>>


Re: multi-core solr, specifying the data directory

Posted by Jonathan Rochkind <ro...@jhu.edu>.
Hmm, okay, have to try to find time to install the example/multicore and 
see.

It's definitely never worked for me, weird.

Thanks.

On 3/1/2011 2:38 PM, Chris Hostetter wrote:
> : Unless I'm doing something wrong, in my experience in multi-core Solr in
> : 1.4.1, you NEED to explicitly provide an absolute path to the 'data' dir.
>
> have you looked at the example/multicore directory that was included in
> the 1.4.1 release?
>
> it has a solr.xml that loads two cores w/o specifying a data dir in the
> solr.xml (or hte solrconfig.xml) and it uses the "data" dir inside the
> specified instanceDir.
>
> If that example works for you, but your own configs do not, then we'll
> need more details about your own configs -- how are you running solr, what
> does the solrconfig.xml of the core look like, etc...
>
>
> -Hoss
>

Re: multi-core solr, specifying the data directory

Posted by Chris Hostetter <ho...@fucit.org>.
: Unless I'm doing something wrong, in my experience in multi-core Solr in
: 1.4.1, you NEED to explicitly provide an absolute path to the 'data' dir.

have you looked at the example/multicore directory that was included in 
the 1.4.1 release?

it has a solr.xml that loads two cores w/o specifying a data dir in the 
solr.xml (or hte solrconfig.xml) and it uses the "data" dir inside the 
specified instanceDir.

If that example works for you, but your own configs do not, then we'll 
need more details about your own configs -- how are you running solr, what 
does the solrconfig.xml of the core look like, etc...


-Hoss

Re: multi-core solr, specifying the data directory

Posted by Michael Sokolov <so...@ifactory.com>.
I spent a few hours chasing my tail on this one; I really just assumed 
that the core's data dir would be under the core's instance dir.  But I 
ended up doing exactly what you did (copying from something I found on 
the web).

seems like a design flaw that could be difficult to fix without breaking 
some older setups?

-Mike

On 2/28/2011 6:00 PM, Jonathan Rochkind wrote:
> Unless I'm doing something wrong, in my experience in multi-core Solr 
> in 1.4.1, you NEED to explicitly provide an absolute path to the 
> 'data' dir.
>
> I set up multi-core like this:
>
> <cores adminPath="/admin/cores">
> <core name="some_core" instanceDir="some_core">
> </core>
> </cores>
>
>
> Now, setting instanceDir like that works for Solr to look for the 
> 'conf' directory in the default location you'd expect, ./some_core/conf.
>
> You'd expect it to look for the 'data' dir for an index in 
> ./some_core/data too, by default.  But it does not seem to. It's still 
> looking for the 'data' directory in the _main_ solr.home/data, not 
> under the relevant core directory.
>
> The only way I can manage to get it to look for the /data directory 
> where I expect is to spell it out with a full absolute path:
>
> <core name="some_core" instanceDir="some_core">
> <property name="dataDir" value="/path/to/main/solr/some_core/data" />
> </core>
>
> And then in the solrconfig.xml do a <dataDir>${dataDir}</dataDir>
>
> Is this what everyone else does too? Or am I missing a better way of 
> doing this?  I would have thought it would "just work", with Solr by 
> default looking for a ./data subdir of the specified instanceDir.  But 
> it definitely doesn't seem to do that.
>
> Should it? Anyone know if Solr in trunk past 1.4.1 has been changed to 
> do what I expect? Or am I wrong to expect it? Or does everyone else do 
> multi-core in some different way than me where this doesn't come up?
>
> Jonathan
>


Re: multi-core solr, specifying the data directory

Posted by Nagendra Nagarajayya <nn...@transaxtions.com>.
HI Jonathan:

Did you try :

<cores adminPath="/admin/cores" >
<core name="some_core" instanceDir="some_core" dataDir="data">
</core>

This should create the indexes under some_core/data or you can make 
datadir relative to some_core dir.

Regards,

- NN
http://solr-ra.tgels.com
http://rankingalgorithm.tgels.com



On 3/1/2011 7:21 AM, Jonathan Rochkind wrote:
> I did try that, yes. I tried that first in fact!  It seems to fall 
> back to a ./data directory relative to the _main_ solr directory (the 
> one above all the cores), not the core instancedir.  Which is not what 
> I expected either.
>
> I wonder if this should be considered a bug? I wonder if anyone has 
> considered this and thought of changing/fixing it?
>
> On 3/1/2011 4:23 AM, Jan Høydahl wrote:
>> Have you tried removing the<dataDir>  tag from solrconfig.xml? Then 
>> it should fall back to default ./data relative to core instancedir.
>>
>> -- 
>> Jan Høydahl, search solution architect
>> Cominvent AS - www.cominvent.com
>>
>> On 1. mars 2011, at 00.00, Jonathan Rochkind wrote:
>>
>>> Unless I'm doing something wrong, in my experience in multi-core 
>>> Solr in 1.4.1, you NEED to explicitly provide an absolute path to 
>>> the 'data' dir.
>>>
>>> I set up multi-core like this:
>>>
>>> <cores adminPath="/admin/cores">
>>> <core name="some_core" instanceDir="some_core">
>>> </core>
>>> </cores>
>>>
>>>
>>> Now, setting instanceDir like that works for Solr to look for the 
>>> 'conf' directory in the default location you'd expect, 
>>> ./some_core/conf.
>>>
>>> You'd expect it to look for the 'data' dir for an index in 
>>> ./some_core/data too, by default.  But it does not seem to. It's 
>>> still looking for the 'data' directory in the _main_ solr.home/data, 
>>> not under the relevant core directory.
>>>
>>> The only way I can manage to get it to look for the /data directory 
>>> where I expect is to spell it out with a full absolute path:
>>>
>>> <core name="some_core" instanceDir="some_core">
>>> <property name="dataDir" value="/path/to/main/solr/some_core/data" />
>>> </core>
>>>
>>> And then in the solrconfig.xml do a<dataDir>${dataDir}</dataDir>
>>>
>>> Is this what everyone else does too? Or am I missing a better way of 
>>> doing this?  I would have thought it would "just work", with Solr by 
>>> default looking for a ./data subdir of the specified instanceDir.  
>>> But it definitely doesn't seem to do that.
>>>
>>> Should it? Anyone know if Solr in trunk past 1.4.1 has been changed 
>>> to do what I expect? Or am I wrong to expect it? Or does everyone 
>>> else do multi-core in some different way than me where this doesn't 
>>> come up?
>>>
>>> Jonathan
>>>
>>
>
>


Re: multi-core solr, specifying the data directory

Posted by Jonathan Rochkind <ro...@jhu.edu>.
I did try that, yes. I tried that first in fact!  It seems to fall back 
to a ./data directory relative to the _main_ solr directory (the one 
above all the cores), not the core instancedir.  Which is not what I 
expected either.

I wonder if this should be considered a bug? I wonder if anyone has 
considered this and thought of changing/fixing it?

On 3/1/2011 4:23 AM, Jan Høydahl wrote:
> Have you tried removing the<dataDir>  tag from solrconfig.xml? Then it should fall back to default ./data relative to core instancedir.
>
> --
> Jan Høydahl, search solution architect
> Cominvent AS - www.cominvent.com
>
> On 1. mars 2011, at 00.00, Jonathan Rochkind wrote:
>
>> Unless I'm doing something wrong, in my experience in multi-core Solr in 1.4.1, you NEED to explicitly provide an absolute path to the 'data' dir.
>>
>> I set up multi-core like this:
>>
>> <cores adminPath="/admin/cores">
>> <core name="some_core" instanceDir="some_core">
>> </core>
>> </cores>
>>
>>
>> Now, setting instanceDir like that works for Solr to look for the 'conf' directory in the default location you'd expect, ./some_core/conf.
>>
>> You'd expect it to look for the 'data' dir for an index in ./some_core/data too, by default.  But it does not seem to. It's still looking for the 'data' directory in the _main_ solr.home/data, not under the relevant core directory.
>>
>> The only way I can manage to get it to look for the /data directory where I expect is to spell it out with a full absolute path:
>>
>> <core name="some_core" instanceDir="some_core">
>> <property name="dataDir" value="/path/to/main/solr/some_core/data" />
>> </core>
>>
>> And then in the solrconfig.xml do a<dataDir>${dataDir}</dataDir>
>>
>> Is this what everyone else does too? Or am I missing a better way of doing this?  I would have thought it would "just work", with Solr by default looking for a ./data subdir of the specified instanceDir.  But it definitely doesn't seem to do that.
>>
>> Should it? Anyone know if Solr in trunk past 1.4.1 has been changed to do what I expect? Or am I wrong to expect it? Or does everyone else do multi-core in some different way than me where this doesn't come up?
>>
>> Jonathan
>>
>

Re: multi-core solr, specifying the data directory

Posted by Jan Høydahl <ja...@cominvent.com>.
Have you tried removing the <dataDir> tag from solrconfig.xml? Then it should fall back to default ./data relative to core instancedir.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

On 1. mars 2011, at 00.00, Jonathan Rochkind wrote:

> Unless I'm doing something wrong, in my experience in multi-core Solr in 1.4.1, you NEED to explicitly provide an absolute path to the 'data' dir.
> 
> I set up multi-core like this:
> 
> <cores adminPath="/admin/cores">
> <core name="some_core" instanceDir="some_core">
> </core>
> </cores>
> 
> 
> Now, setting instanceDir like that works for Solr to look for the 'conf' directory in the default location you'd expect, ./some_core/conf.
> 
> You'd expect it to look for the 'data' dir for an index in ./some_core/data too, by default.  But it does not seem to. It's still looking for the 'data' directory in the _main_ solr.home/data, not under the relevant core directory.
> 
> The only way I can manage to get it to look for the /data directory where I expect is to spell it out with a full absolute path:
> 
> <core name="some_core" instanceDir="some_core">
> <property name="dataDir" value="/path/to/main/solr/some_core/data" />
> </core>
> 
> And then in the solrconfig.xml do a <dataDir>${dataDir}</dataDir>
> 
> Is this what everyone else does too? Or am I missing a better way of doing this?  I would have thought it would "just work", with Solr by default looking for a ./data subdir of the specified instanceDir.  But it definitely doesn't seem to do that.
> 
> Should it? Anyone know if Solr in trunk past 1.4.1 has been changed to do what I expect? Or am I wrong to expect it? Or does everyone else do multi-core in some different way than me where this doesn't come up?
> 
> Jonathan
>