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 adeelmahmood <ad...@gmail.com> on 2013/03/03 04:18:22 UTC

create cores dynamically

I am not sure if I understand how the creating cores dynamically
functionality is supposed to work. From what I have sort of figured out is
that I need to specify the instanceDir as the path to a directory which
contains the conf file. So I have directory as template for configuration
files but when I use this path, solr adds the data directory next to this
template conf directory which defeats the purpose. I was hoping that it will
copy the template files into a new directory created for the core. Is that
not how its supposed to work.

Any help is appreciated.

Thanks
Adeel



--
View this message in context: http://lucene.472066.n3.nabble.com/create-cores-dynamically-tp4044279.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: create cores dynamically

Posted by Shawn Heisey <so...@elyograg.org>.
On 3/3/2013 12:08 PM, adeelmahmood wrote:
> Well this is all useful information but not sure if it really answers my
> question. Let me rephrase what exactly I am trying to do. Lets say I start
> with core0 so this is how the directory structure looks like
>
> solr.home
> -> solr.xml
> -> core0
>    -> conf
>    -> data
>
> now when I want to dynamically add core1 i want to end up with a structure
> like this
>
> solr.home
> -> solr.xml
> -> core0
>    -> conf
>    -> data
> -> core1
>    -> conf
>    -> data
>
> is this possible with dynamic core creation, to have a seperate directory
> with conf and data directory inside it for each core separetely

Yes, you can do this.  You'll need to create the new core directory and 
its conf directory before creating the core within Solr, Solr doesn't do 
that part for you.  Solr will automatically create the data directory, 
though.

On my setup, I don't create cores dynamically.  I have a central config 
directory and I create symlinks within the individual core config 
directories back to the central.

Thanks,
Shawn


Re: create cores dynamically

Posted by adeelmahmood <ad...@gmail.com>.
Well this is all useful information but not sure if it really answers my
question. Let me rephrase what exactly I am trying to do. Lets say I start
with core0 so this is how the directory structure looks like

solr.home
-> solr.xml
-> core0
  -> conf
  -> data

now when I want to dynamically add core1 i want to end up with a structure
like this

solr.home
-> solr.xml
-> core0
  -> conf
  -> data
-> core1
  -> conf
  -> data

is this possible with dynamic core creation, to have a seperate directory
with conf and data directory inside it for each core separetely

Thanks for the help



--
View this message in context: http://lucene.472066.n3.nabble.com/create-cores-dynamically-tp4044279p4044389.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: create cores dynamically

Posted by Shawn Heisey <so...@elyograg.org>.
On 3/2/2013 8:18 PM, adeelmahmood wrote:
> I am not sure if I understand how the creating cores dynamically
> functionality is supposed to work. From what I have sort of figured out is
> that I need to specify the instanceDir as the path to a directory which
> contains the conf file. So I have directory as template for configuration
> files but when I use this path, solr adds the data directory next to this
> template conf directory which defeats the purpose. I was hoping that it will
> copy the template files into a new directory created for the core. Is that
> not how its supposed to work.

In solr.xml, instanceDir is relative to solr.solr.home, which defaults 
to solr, relative to the current working directory.  The solr.solr.home 
directory is where solr.xml lives.  Inside instanceDir, solr looks in 
conf to find the config.  The value for dataDir defaults to data, 
relative to instanceDir.  I don't think instanceDir has a default value, 
but I could be wrong about that.

Here's what I use, with solr.solr.home set to /index/solr4:

<core loadOnStartup="true" instanceDir="cores/ncmain/" transient="false" 
name="ncmain" dataDir="../../data/ncmain"/>

This means that all config directories are under /index/solr4/cores and 
all index directories are under /index/solr4/data ... I can easily 
delete all the data without touching the configs.

For another installation where I'm using SolrCloud, it is set up a 
almost the same, but it's still separated because the active configs are 
in zookeeper, with a backup copy on the disk.

Thanks,
Shawn


Re: create cores dynamically

Posted by Jilal Oussama <ji...@gmail.com>.
For me, it always creates the data dir next to the conf dir I specified
(this should depend on your core configuration) and load the core into solr
(and I think this is what it is suposed to do)
On Mar 3, 2013 3:18 AM, "adeelmahmood" <ad...@gmail.com> wrote:

> I am not sure if I understand how the creating cores dynamically
> functionality is supposed to work. From what I have sort of figured out is
> that I need to specify the instanceDir as the path to a directory which
> contains the conf file. So I have directory as template for configuration
> files but when I use this path, solr adds the data directory next to this
> template conf directory which defeats the purpose. I was hoping that it
> will
> copy the template files into a new directory created for the core. Is that
> not how its supposed to work.
>
> Any help is appreciated.
>
> Thanks
> Adeel
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/create-cores-dynamically-tp4044279.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>