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 vivek sar <vi...@gmail.com> on 2009/04/01 04:11:51 UTC

Defining DataDir in Multi-Core

Hi,

  I'm trying to set up cores dynamically. I want to use the same
schema.xml and solrconfig.xml for all the created cores, so plan to
pass the same instance directory, but different dir directory. Here is
what I got in solr.xml by default (I didn't want define any core here,
but looks like we have to have at least one core defined before we
start the Solr).

<solr persistent="true">
    <cores adminPath="/admin/cores">
      <core name="core0" instanceDir="."/>
    </cores>
</solr>

Now I run the following URL in the browser (as described on wiki -
http://wiki.apache.org/solr/CoreAdmin),

http://localhost:8080/solr/admin/cores?action=CREATE&name=20090331_1&instanceDir=/Users/opal/temp/chat/solr&dataDir=/Users/opal/temp/chat/solr/data/20090331_1

I get a response,

<str name="saved">/Users/opal/temp/chat/solr/solr.xml</str>

Now when I check the solr.xml I see,

<?xml version='1.0' encoding='UTF-8'?><solr persistent='true'>
<cores adminPath='/admin/cores'>
  <core name='core0' instanceDir='./'/>
  <core name='20090331_2' instanceDir='/Users/opal/temp/afterchat/solr/'/>
</cores>
</solr>

Note, there is NO dir directory specified. When I check the status
(http://localhost:8080/solr/admin/cores?action=STATUS) I see,

<str name="name">core0</str>
<str name="instanceDir">/Users/opal/temp/afterchat/solr/./</str>
<str name="dataDir">/Users/opal/temp/afterchat/solr/./data/</str>
...

<str name="name">20090331_2</str>
<str name="instanceDir">/Users/opal/temp/afterchat/solr/</str>
<str name="dataDir">/Users/opal/temp/afterchat/solr/data/</str>

both cores are pointing to the same data directory. My question is how
can I create cores on fly and have them point to different data
directories so each core write index in different location?

Thanks,
-vivek

Re: Defining DataDir in Multi-Core

Posted by RaghavPrabhu <ra...@gmail.com>.
Hi,

    Thanks for replying me..

   Do you have any idea about to split the index in to different cores? If
so, kindly let me know please..


Thanks & regards
Prabhu.K


vivek sar wrote:
> 
> Yeah, it was sometime back - it did work. Thanks for following up.
> 
> On Tue, May 19, 2009 at 12:34 AM, RaghavPrabhu <ra...@gmail.com>
> wrote:
>>
>> Hi Vivek,
>>
>>  Have you figure out the problem of creating the data dir in wrong
>> location?
>>
>>  For me its working...
>>
>>   Just comment the data dir (in solrconfig.xml file) and create the core
>> via REST call. It should work!!!
>>
>> Thanks & regards
>> Prabhu.K
>>
>>
>>
>> vivek sar wrote:
>>>
>>> Hi,
>>>
>>>   I tried the latest nightly build (04-01-09) - it takes the dataDir
>>> property now, but it's creating the Data dir at the wrong location.
>>> For ex., I've the following in solr.xml,
>>>
>>> <solr persistent="true">
>>>     <cores adminPath="/admin/cores">
>>>       <core name="core0" instanceDir="/Users/opal/temp/chat/solr"
>>> dataDir="/Users/opal/temp/afterchat/solr/data/core0"/>
>>>     </cores>
>>> </solr>
>>>
>>> but, it always seem to be creating the solr/data directory in the cwd
>>> (where I started the Tomcat from). Here is the log from Catalina.out,
>>>
>>> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore <init>
>>> INFO: [core2] Opening new SolrCore at /Users/opal/temp/chat/solr/,
>>> dataDir=./solr/data/
>>> ..
>>> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore initIndex
>>> WARNING: [core2] Solr index directory './solr/data/index' doesn't
>>> exist. Creating new index...
>>>
>>> I've also tried relative paths, but to no avail.
>>>
>>> Is this a bug?
>>>
>>> Thanks,
>>> -vivek
>>>
>>> On Wed, Apr 1, 2009 at 9:45 AM, vivek sar <vi...@gmail.com> wrote:
>>>> Thanks Shalin.
>>>>
>>>> Is it available in the latest nightly build?
>>>>
>>>> Is there any other way I can create cores dynamically (using CREATE
>>>> service) which will use the same schema.xml and solrconfig.xml, but
>>>> write to different data directories?
>>>>
>>>> Thanks,
>>>> -vivek
>>>>
>>>> On Wed, Apr 1, 2009 at 1:55 AM, Shalin Shekhar Mangar
>>>> <sh...@gmail.com> wrote:
>>>>> On Wed, Apr 1, 2009 at 1:48 PM, vivek sar <vi...@gmail.com> wrote:
>>>>>> I'm using the latest released one - Solr 1.3. The wiki says passing
>>>>>> dataDir to CREATE action (web service) should work, but that doesn't
>>>>>> seem to be working.
>>>>>>
>>>>>
>>>>> That is a Solr 1.4 feature (not released yet).
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Shalin Shekhar Mangar.
>>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Defining-DataDir-in-Multi-Core-tp22818543p23611179.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Defining-DataDir-in-Multi-Core-tp22818543p23612367.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Defining DataDir in Multi-Core

Posted by vivek sar <vi...@gmail.com>.
As per splitting the index, I simply start a new core once a core
reaches a certain size - using CREATE and then start writing to that
new core. Note that Solr will maintain all the cores defined in the
solr.xml.

As per reusing the same schema and solrconfig.xml - you can create a
default core (say core0) and put in the conf directory there. In the
solr.xml for every new core set the instanceDir to core0 and its
dataDir to the new core's data directory.

Hope this helps.

-vivek

2009/5/19 Noble Paul നോബിള്‍  नोब्ळ् <no...@corp.aol.com>:
> On Tue, May 19, 2009 at 2:32 PM, KK <di...@gmail.com> wrote:
>> I could not follow[is this mail a continuation of some old mail, a part of
>> which seems to be missing], but I want to.
>> Is it the case that CREATE is to be supported by solr1.4 i.e currently
>> solr1.3 doesnot support this? Correct me if I'm wrong .
> CREATE is supported in Solr1.3 also
>
> the dataDir attribute is a new feature in 1.4
>>
>> Vivek could you please tell me how did you fix the problem of using a single
>> schema and config file for all cores and having different data directories.
>> I'm stuck at the same point as you were. Please help me out. Can you provide
>> some specific examples that shows the way you used the create statement to
>> register new cores on the fly. Thank you .
>>
>> --KK
>>
>> On Tue, May 19, 2009 at 1:17 PM, vivek sar <vi...@gmail.com> wrote:
>>
>>> Yeah, it was sometime back - it did work. Thanks for following up.
>>>
>>> On Tue, May 19, 2009 at 12:34 AM, RaghavPrabhu <ra...@gmail.com>
>>> wrote:
>>> >
>>> > Hi Vivek,
>>> >
>>> >  Have you figure out the problem of creating the data dir in wrong
>>> > location?
>>> >
>>> >  For me its working...
>>> >
>>> >   Just comment the data dir (in solrconfig.xml file) and create the core
>>> > via REST call. It should work!!!
>>> >
>>> > Thanks & regards
>>> > Prabhu.K
>>> >
>>> >
>>> >
>>> > vivek sar wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >>   I tried the latest nightly build (04-01-09) - it takes the dataDir
>>> >> property now, but it's creating the Data dir at the wrong location.
>>> >> For ex., I've the following in solr.xml,
>>> >>
>>> >> <solr persistent="true">
>>> >>     <cores adminPath="/admin/cores">
>>> >>       <core name="core0" instanceDir="/Users/opal/temp/chat/solr"
>>> >> dataDir="/Users/opal/temp/afterchat/solr/data/core0"/>
>>> >>     </cores>
>>> >> </solr>
>>> >>
>>> >> but, it always seem to be creating the solr/data directory in the cwd
>>> >> (where I started the Tomcat from). Here is the log from Catalina.out,
>>> >>
>>> >> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore <init>
>>> >> INFO: [core2] Opening new SolrCore at /Users/opal/temp/chat/solr/,
>>> >> dataDir=./solr/data/
>>> >> ..
>>> >> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore initIndex
>>> >> WARNING: [core2] Solr index directory './solr/data/index' doesn't
>>> >> exist. Creating new index...
>>> >>
>>> >> I've also tried relative paths, but to no avail.
>>> >>
>>> >> Is this a bug?
>>> >>
>>> >> Thanks,
>>> >> -vivek
>>> >>
>>> >> On Wed, Apr 1, 2009 at 9:45 AM, vivek sar <vi...@gmail.com> wrote:
>>> >>> Thanks Shalin.
>>> >>>
>>> >>> Is it available in the latest nightly build?
>>> >>>
>>> >>> Is there any other way I can create cores dynamically (using CREATE
>>> >>> service) which will use the same schema.xml and solrconfig.xml, but
>>> >>> write to different data directories?
>>> >>>
>>> >>> Thanks,
>>> >>> -vivek
>>> >>>
>>> >>> On Wed, Apr 1, 2009 at 1:55 AM, Shalin Shekhar Mangar
>>> >>> <sh...@gmail.com> wrote:
>>> >>>> On Wed, Apr 1, 2009 at 1:48 PM, vivek sar <vi...@gmail.com> wrote:
>>> >>>>> I'm using the latest released one - Solr 1.3. The wiki says passing
>>> >>>>> dataDir to CREATE action (web service) should work, but that doesn't
>>> >>>>> seem to be working.
>>> >>>>>
>>> >>>>
>>> >>>> That is a Solr 1.4 feature (not released yet).
>>> >>>>
>>> >>>> --
>>> >>>> Regards,
>>> >>>> Shalin Shekhar Mangar.
>>> >>>>
>>> >>>
>>> >>
>>> >>
>>> >
>>> > --
>>> > View this message in context:
>>> http://www.nabble.com/Defining-DataDir-in-Multi-Core-tp22818543p23611179.html
>>> > Sent from the Solr - User mailing list archive at Nabble.com.
>>> >
>>> >
>>>
>>
>
>
>
> --
> -----------------------------------------------------
> Noble Paul | Principal Engineer| AOL | http://aol.com
>

Re: Defining DataDir in Multi-Core

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
On Tue, May 19, 2009 at 2:32 PM, KK <di...@gmail.com> wrote:
> I could not follow[is this mail a continuation of some old mail, a part of
> which seems to be missing], but I want to.
> Is it the case that CREATE is to be supported by solr1.4 i.e currently
> solr1.3 doesnot support this? Correct me if I'm wrong .
CREATE is supported in Solr1.3 also

the dataDir attribute is a new feature in 1.4
>
> Vivek could you please tell me how did you fix the problem of using a single
> schema and config file for all cores and having different data directories.
> I'm stuck at the same point as you were. Please help me out. Can you provide
> some specific examples that shows the way you used the create statement to
> register new cores on the fly. Thank you .
>
> --KK
>
> On Tue, May 19, 2009 at 1:17 PM, vivek sar <vi...@gmail.com> wrote:
>
>> Yeah, it was sometime back - it did work. Thanks for following up.
>>
>> On Tue, May 19, 2009 at 12:34 AM, RaghavPrabhu <ra...@gmail.com>
>> wrote:
>> >
>> > Hi Vivek,
>> >
>> >  Have you figure out the problem of creating the data dir in wrong
>> > location?
>> >
>> >  For me its working...
>> >
>> >   Just comment the data dir (in solrconfig.xml file) and create the core
>> > via REST call. It should work!!!
>> >
>> > Thanks & regards
>> > Prabhu.K
>> >
>> >
>> >
>> > vivek sar wrote:
>> >>
>> >> Hi,
>> >>
>> >>   I tried the latest nightly build (04-01-09) - it takes the dataDir
>> >> property now, but it's creating the Data dir at the wrong location.
>> >> For ex., I've the following in solr.xml,
>> >>
>> >> <solr persistent="true">
>> >>     <cores adminPath="/admin/cores">
>> >>       <core name="core0" instanceDir="/Users/opal/temp/chat/solr"
>> >> dataDir="/Users/opal/temp/afterchat/solr/data/core0"/>
>> >>     </cores>
>> >> </solr>
>> >>
>> >> but, it always seem to be creating the solr/data directory in the cwd
>> >> (where I started the Tomcat from). Here is the log from Catalina.out,
>> >>
>> >> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore <init>
>> >> INFO: [core2] Opening new SolrCore at /Users/opal/temp/chat/solr/,
>> >> dataDir=./solr/data/
>> >> ..
>> >> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore initIndex
>> >> WARNING: [core2] Solr index directory './solr/data/index' doesn't
>> >> exist. Creating new index...
>> >>
>> >> I've also tried relative paths, but to no avail.
>> >>
>> >> Is this a bug?
>> >>
>> >> Thanks,
>> >> -vivek
>> >>
>> >> On Wed, Apr 1, 2009 at 9:45 AM, vivek sar <vi...@gmail.com> wrote:
>> >>> Thanks Shalin.
>> >>>
>> >>> Is it available in the latest nightly build?
>> >>>
>> >>> Is there any other way I can create cores dynamically (using CREATE
>> >>> service) which will use the same schema.xml and solrconfig.xml, but
>> >>> write to different data directories?
>> >>>
>> >>> Thanks,
>> >>> -vivek
>> >>>
>> >>> On Wed, Apr 1, 2009 at 1:55 AM, Shalin Shekhar Mangar
>> >>> <sh...@gmail.com> wrote:
>> >>>> On Wed, Apr 1, 2009 at 1:48 PM, vivek sar <vi...@gmail.com> wrote:
>> >>>>> I'm using the latest released one - Solr 1.3. The wiki says passing
>> >>>>> dataDir to CREATE action (web service) should work, but that doesn't
>> >>>>> seem to be working.
>> >>>>>
>> >>>>
>> >>>> That is a Solr 1.4 feature (not released yet).
>> >>>>
>> >>>> --
>> >>>> Regards,
>> >>>> Shalin Shekhar Mangar.
>> >>>>
>> >>>
>> >>
>> >>
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Defining-DataDir-in-Multi-Core-tp22818543p23611179.html
>> > Sent from the Solr - User mailing list archive at Nabble.com.
>> >
>> >
>>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: Defining DataDir in Multi-Core

Posted by KK <di...@gmail.com>.
I could not follow[is this mail a continuation of some old mail, a part of
which seems to be missing], but I want to.
Is it the case that CREATE is to be supported by solr1.4 i.e currently
solr1.3 doesnot support this? Correct me if I'm wrong .

Vivek could you please tell me how did you fix the problem of using a single
schema and config file for all cores and having different data directories.
I'm stuck at the same point as you were. Please help me out. Can you provide
some specific examples that shows the way you used the create statement to
register new cores on the fly. Thank you .

--KK

On Tue, May 19, 2009 at 1:17 PM, vivek sar <vi...@gmail.com> wrote:

> Yeah, it was sometime back - it did work. Thanks for following up.
>
> On Tue, May 19, 2009 at 12:34 AM, RaghavPrabhu <ra...@gmail.com>
> wrote:
> >
> > Hi Vivek,
> >
> >  Have you figure out the problem of creating the data dir in wrong
> > location?
> >
> >  For me its working...
> >
> >   Just comment the data dir (in solrconfig.xml file) and create the core
> > via REST call. It should work!!!
> >
> > Thanks & regards
> > Prabhu.K
> >
> >
> >
> > vivek sar wrote:
> >>
> >> Hi,
> >>
> >>   I tried the latest nightly build (04-01-09) - it takes the dataDir
> >> property now, but it's creating the Data dir at the wrong location.
> >> For ex., I've the following in solr.xml,
> >>
> >> <solr persistent="true">
> >>     <cores adminPath="/admin/cores">
> >>       <core name="core0" instanceDir="/Users/opal/temp/chat/solr"
> >> dataDir="/Users/opal/temp/afterchat/solr/data/core0"/>
> >>     </cores>
> >> </solr>
> >>
> >> but, it always seem to be creating the solr/data directory in the cwd
> >> (where I started the Tomcat from). Here is the log from Catalina.out,
> >>
> >> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore <init>
> >> INFO: [core2] Opening new SolrCore at /Users/opal/temp/chat/solr/,
> >> dataDir=./solr/data/
> >> ..
> >> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore initIndex
> >> WARNING: [core2] Solr index directory './solr/data/index' doesn't
> >> exist. Creating new index...
> >>
> >> I've also tried relative paths, but to no avail.
> >>
> >> Is this a bug?
> >>
> >> Thanks,
> >> -vivek
> >>
> >> On Wed, Apr 1, 2009 at 9:45 AM, vivek sar <vi...@gmail.com> wrote:
> >>> Thanks Shalin.
> >>>
> >>> Is it available in the latest nightly build?
> >>>
> >>> Is there any other way I can create cores dynamically (using CREATE
> >>> service) which will use the same schema.xml and solrconfig.xml, but
> >>> write to different data directories?
> >>>
> >>> Thanks,
> >>> -vivek
> >>>
> >>> On Wed, Apr 1, 2009 at 1:55 AM, Shalin Shekhar Mangar
> >>> <sh...@gmail.com> wrote:
> >>>> On Wed, Apr 1, 2009 at 1:48 PM, vivek sar <vi...@gmail.com> wrote:
> >>>>> I'm using the latest released one - Solr 1.3. The wiki says passing
> >>>>> dataDir to CREATE action (web service) should work, but that doesn't
> >>>>> seem to be working.
> >>>>>
> >>>>
> >>>> That is a Solr 1.4 feature (not released yet).
> >>>>
> >>>> --
> >>>> Regards,
> >>>> Shalin Shekhar Mangar.
> >>>>
> >>>
> >>
> >>
> >
> > --
> > View this message in context:
> http://www.nabble.com/Defining-DataDir-in-Multi-Core-tp22818543p23611179.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
> >
> >
>

Re: Defining DataDir in Multi-Core

Posted by vivek sar <vi...@gmail.com>.
Yeah, it was sometime back - it did work. Thanks for following up.

On Tue, May 19, 2009 at 12:34 AM, RaghavPrabhu <ra...@gmail.com> wrote:
>
> Hi Vivek,
>
>  Have you figure out the problem of creating the data dir in wrong
> location?
>
>  For me its working...
>
>   Just comment the data dir (in solrconfig.xml file) and create the core
> via REST call. It should work!!!
>
> Thanks & regards
> Prabhu.K
>
>
>
> vivek sar wrote:
>>
>> Hi,
>>
>>   I tried the latest nightly build (04-01-09) - it takes the dataDir
>> property now, but it's creating the Data dir at the wrong location.
>> For ex., I've the following in solr.xml,
>>
>> <solr persistent="true">
>>     <cores adminPath="/admin/cores">
>>       <core name="core0" instanceDir="/Users/opal/temp/chat/solr"
>> dataDir="/Users/opal/temp/afterchat/solr/data/core0"/>
>>     </cores>
>> </solr>
>>
>> but, it always seem to be creating the solr/data directory in the cwd
>> (where I started the Tomcat from). Here is the log from Catalina.out,
>>
>> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore <init>
>> INFO: [core2] Opening new SolrCore at /Users/opal/temp/chat/solr/,
>> dataDir=./solr/data/
>> ..
>> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore initIndex
>> WARNING: [core2] Solr index directory './solr/data/index' doesn't
>> exist. Creating new index...
>>
>> I've also tried relative paths, but to no avail.
>>
>> Is this a bug?
>>
>> Thanks,
>> -vivek
>>
>> On Wed, Apr 1, 2009 at 9:45 AM, vivek sar <vi...@gmail.com> wrote:
>>> Thanks Shalin.
>>>
>>> Is it available in the latest nightly build?
>>>
>>> Is there any other way I can create cores dynamically (using CREATE
>>> service) which will use the same schema.xml and solrconfig.xml, but
>>> write to different data directories?
>>>
>>> Thanks,
>>> -vivek
>>>
>>> On Wed, Apr 1, 2009 at 1:55 AM, Shalin Shekhar Mangar
>>> <sh...@gmail.com> wrote:
>>>> On Wed, Apr 1, 2009 at 1:48 PM, vivek sar <vi...@gmail.com> wrote:
>>>>> I'm using the latest released one - Solr 1.3. The wiki says passing
>>>>> dataDir to CREATE action (web service) should work, but that doesn't
>>>>> seem to be working.
>>>>>
>>>>
>>>> That is a Solr 1.4 feature (not released yet).
>>>>
>>>> --
>>>> Regards,
>>>> Shalin Shekhar Mangar.
>>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Defining-DataDir-in-Multi-Core-tp22818543p23611179.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>

Re: Defining DataDir in Multi-Core

Posted by RaghavPrabhu <ra...@gmail.com>.
Hi Vivek,
 
  Have you figure out the problem of creating the data dir in wrong
location?
 
  For me its working...
  
   Just comment the data dir (in solrconfig.xml file) and create the core
via REST call. It should work!!!

Thanks & regards
Prabhu.K



vivek sar wrote:
> 
> Hi,
> 
>   I tried the latest nightly build (04-01-09) - it takes the dataDir
> property now, but it's creating the Data dir at the wrong location.
> For ex., I've the following in solr.xml,
> 
> <solr persistent="true">
>     <cores adminPath="/admin/cores">
>       <core name="core0" instanceDir="/Users/opal/temp/chat/solr"
> dataDir="/Users/opal/temp/afterchat/solr/data/core0"/>
>     </cores>
> </solr>
> 
> but, it always seem to be creating the solr/data directory in the cwd
> (where I started the Tomcat from). Here is the log from Catalina.out,
> 
> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore <init>
> INFO: [core2] Opening new SolrCore at /Users/opal/temp/chat/solr/,
> dataDir=./solr/data/
> ..
> Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore initIndex
> WARNING: [core2] Solr index directory './solr/data/index' doesn't
> exist. Creating new index...
> 
> I've also tried relative paths, but to no avail.
> 
> Is this a bug?
> 
> Thanks,
> -vivek
> 
> On Wed, Apr 1, 2009 at 9:45 AM, vivek sar <vi...@gmail.com> wrote:
>> Thanks Shalin.
>>
>> Is it available in the latest nightly build?
>>
>> Is there any other way I can create cores dynamically (using CREATE
>> service) which will use the same schema.xml and solrconfig.xml, but
>> write to different data directories?
>>
>> Thanks,
>> -vivek
>>
>> On Wed, Apr 1, 2009 at 1:55 AM, Shalin Shekhar Mangar
>> <sh...@gmail.com> wrote:
>>> On Wed, Apr 1, 2009 at 1:48 PM, vivek sar <vi...@gmail.com> wrote:
>>>> I'm using the latest released one - Solr 1.3. The wiki says passing
>>>> dataDir to CREATE action (web service) should work, but that doesn't
>>>> seem to be working.
>>>>
>>>
>>> That is a Solr 1.4 feature (not released yet).
>>>
>>> --
>>> Regards,
>>> Shalin Shekhar Mangar.
>>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Defining-DataDir-in-Multi-Core-tp22818543p23611179.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Defining DataDir in Multi-Core

Posted by vivek sar <vi...@gmail.com>.
Hi,

  I tried the latest nightly build (04-01-09) - it takes the dataDir
property now, but it's creating the Data dir at the wrong location.
For ex., I've the following in solr.xml,

<solr persistent="true">
    <cores adminPath="/admin/cores">
      <core name="core0" instanceDir="/Users/opal/temp/chat/solr"
dataDir="/Users/opal/temp/afterchat/solr/data/core0"/>
    </cores>
</solr>

but, it always seem to be creating the solr/data directory in the cwd
(where I started the Tomcat from). Here is the log from Catalina.out,

Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore <init>
INFO: [core2] Opening new SolrCore at /Users/opal/temp/chat/solr/,
dataDir=./solr/data/
..
Apr 1, 2009 10:47:21 AM org.apache.solr.core.SolrCore initIndex
WARNING: [core2] Solr index directory './solr/data/index' doesn't
exist. Creating new index...

I've also tried relative paths, but to no avail.

Is this a bug?

Thanks,
-vivek

On Wed, Apr 1, 2009 at 9:45 AM, vivek sar <vi...@gmail.com> wrote:
> Thanks Shalin.
>
> Is it available in the latest nightly build?
>
> Is there any other way I can create cores dynamically (using CREATE
> service) which will use the same schema.xml and solrconfig.xml, but
> write to different data directories?
>
> Thanks,
> -vivek
>
> On Wed, Apr 1, 2009 at 1:55 AM, Shalin Shekhar Mangar
> <sh...@gmail.com> wrote:
>> On Wed, Apr 1, 2009 at 1:48 PM, vivek sar <vi...@gmail.com> wrote:
>>> I'm using the latest released one - Solr 1.3. The wiki says passing
>>> dataDir to CREATE action (web service) should work, but that doesn't
>>> seem to be working.
>>>
>>
>> That is a Solr 1.4 feature (not released yet).
>>
>> --
>> Regards,
>> Shalin Shekhar Mangar.
>>
>

Re: Defining DataDir in Multi-Core

Posted by vivek sar <vi...@gmail.com>.
Thanks Shalin.

Is it available in the latest nightly build?

Is there any other way I can create cores dynamically (using CREATE
service) which will use the same schema.xml and solrconfig.xml, but
write to different data directories?

Thanks,
-vivek

On Wed, Apr 1, 2009 at 1:55 AM, Shalin Shekhar Mangar
<sh...@gmail.com> wrote:
> On Wed, Apr 1, 2009 at 1:48 PM, vivek sar <vi...@gmail.com> wrote:
>> I'm using the latest released one - Solr 1.3. The wiki says passing
>> dataDir to CREATE action (web service) should work, but that doesn't
>> seem to be working.
>>
>
> That is a Solr 1.4 feature (not released yet).
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: Defining DataDir in Multi-Core

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Apr 1, 2009 at 1:48 PM, vivek sar <vi...@gmail.com> wrote:
> I'm using the latest released one - Solr 1.3. The wiki says passing
> dataDir to CREATE action (web service) should work, but that doesn't
> seem to be working.
>

That is a Solr 1.4 feature (not released yet).

-- 
Regards,
Shalin Shekhar Mangar.

Re: Defining DataDir in Multi-Core

Posted by vivek sar <vi...@gmail.com>.
I'm using the latest released one - Solr 1.3. The wiki says passing
dataDir to CREATE action (web service) should work, but that doesn't
seem to be working.

-vivek



2009/3/31 Noble Paul നോബിള്‍  नोब्ळ् <no...@gmail.com>:
> which version of Solr are you using? if you are using one from trunk ,
> you can pass the dataDir as an extra parameter?
>
> On Wed, Apr 1, 2009 at 7:41 AM, vivek sar <vi...@gmail.com> wrote:
>> Hi,
>>
>>  I'm trying to set up cores dynamically. I want to use the same
>> schema.xml and solrconfig.xml for all the created cores, so plan to
>> pass the same instance directory, but different dir directory. Here is
>> what I got in solr.xml by default (I didn't want define any core here,
>> but looks like we have to have at least one core defined before we
>> start the Solr).
>>
>> <solr persistent="true">
>>    <cores adminPath="/admin/cores">
>>      <core name="core0" instanceDir="."/>
>>    </cores>
>> </solr>
>>
>> Now I run the following URL in the browser (as described on wiki -
>> http://wiki.apache.org/solr/CoreAdmin),
>>
>> http://localhost:8080/solr/admin/cores?action=CREATE&name=20090331_1&instanceDir=/Users/opal/temp/chat/solr&dataDir=/Users/opal/temp/chat/solr/data/20090331_1
>>
>> I get a response,
>>
>> <str name="saved">/Users/opal/temp/chat/solr/solr.xml</str>
>>
>> Now when I check the solr.xml I see,
>>
>> <?xml version='1.0' encoding='UTF-8'?><solr persistent='true'>
>> <cores adminPath='/admin/cores'>
>>  <core name='core0' instanceDir='./'/>
>>  <core name='20090331_2' instanceDir='/Users/opal/temp/afterchat/solr/'/>
>> </cores>
>> </solr>
>>
>> Note, there is NO dir directory specified. When I check the status
>> (http://localhost:8080/solr/admin/cores?action=STATUS) I see,
>>
>> <str name="name">core0</str>
>> <str name="instanceDir">/Users/opal/temp/afterchat/solr/./</str>
>> <str name="dataDir">/Users/opal/temp/afterchat/solr/./data/</str>
>> ...
>>
>> <str name="name">20090331_2</str>
>> <str name="instanceDir">/Users/opal/temp/afterchat/solr/</str>
>> <str name="dataDir">/Users/opal/temp/afterchat/solr/data/</str>
>>
>> both cores are pointing to the same data directory. My question is how
>> can I create cores on fly and have them point to different data
>> directories so each core write index in different location?
>>
>> Thanks,
>> -vivek
>>
>
>
>
> --
> --Noble Paul
>

Re: Defining DataDir in Multi-Core

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
which version of Solr are you using? if you are using one from trunk ,
you can pass the dataDir as an extra parameter?

On Wed, Apr 1, 2009 at 7:41 AM, vivek sar <vi...@gmail.com> wrote:
> Hi,
>
>  I'm trying to set up cores dynamically. I want to use the same
> schema.xml and solrconfig.xml for all the created cores, so plan to
> pass the same instance directory, but different dir directory. Here is
> what I got in solr.xml by default (I didn't want define any core here,
> but looks like we have to have at least one core defined before we
> start the Solr).
>
> <solr persistent="true">
>    <cores adminPath="/admin/cores">
>      <core name="core0" instanceDir="."/>
>    </cores>
> </solr>
>
> Now I run the following URL in the browser (as described on wiki -
> http://wiki.apache.org/solr/CoreAdmin),
>
> http://localhost:8080/solr/admin/cores?action=CREATE&name=20090331_1&instanceDir=/Users/opal/temp/chat/solr&dataDir=/Users/opal/temp/chat/solr/data/20090331_1
>
> I get a response,
>
> <str name="saved">/Users/opal/temp/chat/solr/solr.xml</str>
>
> Now when I check the solr.xml I see,
>
> <?xml version='1.0' encoding='UTF-8'?><solr persistent='true'>
> <cores adminPath='/admin/cores'>
>  <core name='core0' instanceDir='./'/>
>  <core name='20090331_2' instanceDir='/Users/opal/temp/afterchat/solr/'/>
> </cores>
> </solr>
>
> Note, there is NO dir directory specified. When I check the status
> (http://localhost:8080/solr/admin/cores?action=STATUS) I see,
>
> <str name="name">core0</str>
> <str name="instanceDir">/Users/opal/temp/afterchat/solr/./</str>
> <str name="dataDir">/Users/opal/temp/afterchat/solr/./data/</str>
> ...
>
> <str name="name">20090331_2</str>
> <str name="instanceDir">/Users/opal/temp/afterchat/solr/</str>
> <str name="dataDir">/Users/opal/temp/afterchat/solr/data/</str>
>
> both cores are pointing to the same data directory. My question is how
> can I create cores on fly and have them point to different data
> directories so each core write index in different location?
>
> Thanks,
> -vivek
>



-- 
--Noble Paul