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 Bram Van Dam <br...@intix.eu> on 2013/11/04 10:00:18 UTC

Core admin: create new core

The core admin CREATE function requires that the new instance dir and 
schema/config exist already. Is there a particular reason for this? It 
would be incredible convenient if I could create a core with a new 
schema and new config simply by calling CREATE (maybe providing the 
contents of config.xml and schema.xml as base64 encoded strings in HTTP 
POST or something?).

I'm guessing this isn't currently possible?

Ta,

  - bram

Re: Core admin: create new core

Posted by Erik Hatcher <er...@gmail.com>.
Try -

   bin/solr create -c inventory




> On Mar 6, 2015, at 05:25, manju16832003 <ma...@gmail.com> wrote:
> 
> Solr 5 has been released. I was just giving a try and come across the same
> issue. As I heard over from some documentation, Solr 5 doesn't come with
> default core (example in earlier versions).  And this requires us to create
> a core from Solr Admin. When I tried to create the core, I get the following
> error
> 
> Error CREATEing SolrCore 'inventory': Unable to create core [inventory]
> Caused by: Can't find resource 'solrconfig.xml' in classpath or
> '/Users/manjunath.reddy/Programming/Solr/solr-5.0.0/server/solr/inventory/conf'
> 
> 
> So I had to manually create the core based on my previous experience with
> Solr 4.10 version.
> I guess its quite misleading for new users of Solr. I like the older
> versions of Solr that comes with default cores so that It would be easier to
> follow up on.
> 
> I have attached screen shots for the reference. Is there a work around for
> this?
> <http://lucene.472066.n3.nabble.com/file/n4191378/solr-1.png> 
> <http://lucene.472066.n3.nabble.com/file/n4191378/solr-2.png> 
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Core-admin-create-new-core-tp4099127p4191378.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Core admin: create new core

Posted by Shawn Heisey <ap...@elyograg.org>.
On 3/6/2015 3:25 AM, manju16832003 wrote:
> Solr 5 has been released. I was just giving a try and come across the same
> issue. As I heard over from some documentation, Solr 5 doesn't come with
> default core (example in earlier versions).  And this requires us to create
> a core from Solr Admin. When I tried to create the core, I get the following
> error
> 
> Error CREATEing SolrCore 'inventory': Unable to create core [inventory]
> Caused by: Can't find resource 'solrconfig.xml' in classpath or
> '/Users/manjunath.reddy/Programming/Solr/solr-5.0.0/server/solr/inventory/conf'
> 
> 
> So I had to manually create the core based on my previous experience with
> Solr 4.10 version.
> I guess its quite misleading for new users of Solr. I like the older
> versions of Solr that comes with default cores so that It would be easier to
> follow up on.

Unless you are in SolrCloud mode, creating cores via the admin UI (or
the /admin/cores HTTP API) requires that the core directory and its conf
subdirectory with solrconfig.xml, schema.xml, and other potential files
must already exist in the indicated location.  There's a note right on
the screen for "Add Core" that says this: "instanceDir and dataDir need
to exist before you can create the core".  This was the case for 4.x as
well as 5.0.

That note is slightly misleading ... the dataDir does not need to exist,
just instanceDir and the conf directory.  Solr will create the dataDir
and its contents, if the user running Solr has permission.

There is a configsets functionality that's new in recent versions which
very likely will make it possible to create a core completely from
scratch within the admin UI in non-cloud mode, but I do not know
anything about using it, and I do not think the functionality is exposed
in the admin UI yet.

Learning about cores and/or collections and how to create them is a
hugely important part of using Solr.  In 4.x, users did not need to do
anything to get their first core, and that fact has led to many
problems.  New users don't know how to add a core, and many do not even
know about cores at all.  This requires that they must learn about the
core/collection concepts, and many of them cannot find any info about
the procedure, so they ask for help.  I am glad to help out both here
and on the IRC channel, but it improves the experience of everyone
involved if users become familiar with the concept and methods on their own.

Thanks,
Shawn


Re: Core admin: create new core

Posted by manju16832003 <ma...@gmail.com>.
Solr 5 has been released. I was just giving a try and come across the same
issue. As I heard over from some documentation, Solr 5 doesn't come with
default core (example in earlier versions).  And this requires us to create
a core from Solr Admin. When I tried to create the core, I get the following
error

Error CREATEing SolrCore 'inventory': Unable to create core [inventory]
Caused by: Can't find resource 'solrconfig.xml' in classpath or
'/Users/manjunath.reddy/Programming/Solr/solr-5.0.0/server/solr/inventory/conf'


So I had to manually create the core based on my previous experience with
Solr 4.10 version.
I guess its quite misleading for new users of Solr. I like the older
versions of Solr that comes with default cores so that It would be easier to
follow up on.

I have attached screen shots for the reference. Is there a work around for
this?
<http://lucene.472066.n3.nabble.com/file/n4191378/solr-1.png> 
<http://lucene.472066.n3.nabble.com/file/n4191378/solr-2.png> 



--
View this message in context: http://lucene.472066.n3.nabble.com/Core-admin-create-new-core-tp4099127p4191378.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Core admin: create new core

Posted by Erick Erickson <er...@gmail.com>.
Well, the easiest way is probably the bin/solr script.

Try typing in bin/solr create_core -help

Best,
Erick

On Mon, Jul 11, 2016 at 3:58 PM, ARCbrittany <wi...@msn.com> wrote:
> creating a little API that takes schema/config as input,
> creates the files and then uses the core admin CREATE request. Works
> like a charm.
>
> RE/ Can you help or post how you made  this API
>
>
> Thank you
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Core-admin-create-new-core-tp4099127p4286687.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Core admin: create new core

Posted by ARCbrittany <wi...@msn.com>.
creating a little API that takes schema/config as input,
creates the files and then uses the core admin CREATE request. Works
like a charm. 

RE/ Can you help or post how you made  this API  


Thank you 



--
View this message in context: http://lucene.472066.n3.nabble.com/Core-admin-create-new-core-tp4099127p4286687.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Core admin: create new core

Posted by Erick Erickson <er...@gmail.com>.
If you're really bored, anything you'd like to do for SOLR-4779
would be great!

Best,
Erick


On Tue, Nov 5, 2013 at 5:15 AM, Bram Van Dam <br...@intix.eu> wrote:

> On 11/04/2013 04:06 PM, Bill Bell wrote:
>
>> You could pre create a bunch of directories and base configs. Create as
>> needed. Then use schema less API to set it up ... Or make changes in a
>> script and reload the core..
>>
>
> I ended up creating a little API that takes schema/config as input,
> creates the files and then uses the core admin CREATE request. Works like a
> charm. If I get bored I might just turn it into a solr plugin or something.
>
> Ta for the suggestions!
>
>  - Bram
>

Re: Core admin: create new core

Posted by Bram Van Dam <br...@intix.eu>.
On 11/04/2013 04:06 PM, Bill Bell wrote:
> You could pre create a bunch of directories and base configs. Create as needed. Then use schema less API to set it up ... Or make changes in a script and reload the core..

I ended up creating a little API that takes schema/config as input, 
creates the files and then uses the core admin CREATE request. Works 
like a charm. If I get bored I might just turn it into a solr plugin or 
something.

Ta for the suggestions!

  - Bram

Re: Core admin: create new core

Posted by Bill Bell <bi...@gmail.com>.
You could pre create a bunch of directories and base configs. Create as needed. Then use schema less API to set it up ... Or make changes in a script and reload the core..

Bill Bell
Sent from mobile


> On Nov 4, 2013, at 6:06 AM, Erick Erickson <er...@gmail.com> wrote:
> 
> Right, this has been an issue for a while, there's no current
> way to do this.
> 
> Someday, I'll be able to work on SOLR-4779 which should
> go some toward making this work more easily. It's still not
> exactly what you're looking for, but it might work.
> 
> Of course with SolrCloud you can specify a configuration
> set that is used for multiple collections.
> 
> People are using Puppet or similar to automate this over
> large numbers of nodes, but that's not entirely satisfactory
> either in our case I suspect.
> 
> FWIW,
> Erick
> 
> 
>> On Mon, Nov 4, 2013 at 4:00 AM, Bram Van Dam <br...@intix.eu> wrote:
>> 
>> The core admin CREATE function requires that the new instance dir and
>> schema/config exist already. Is there a particular reason for this? It
>> would be incredible convenient if I could create a core with a new schema
>> and new config simply by calling CREATE (maybe providing the contents of
>> config.xml and schema.xml as base64 encoded strings in HTTP POST or
>> something?).
>> 
>> I'm guessing this isn't currently possible?
>> 
>> Ta,
>> 
>> - bram
>> 

Re: Core admin: create new core

Posted by Erick Erickson <er...@gmail.com>.
Right, this has been an issue for a while, there's no current
way to do this.

Someday, I'll be able to work on SOLR-4779 which should
go some toward making this work more easily. It's still not
exactly what you're looking for, but it might work.

Of course with SolrCloud you can specify a configuration
set that is used for multiple collections.

People are using Puppet or similar to automate this over
large numbers of nodes, but that's not entirely satisfactory
either in our case I suspect.

FWIW,
Erick


On Mon, Nov 4, 2013 at 4:00 AM, Bram Van Dam <br...@intix.eu> wrote:

> The core admin CREATE function requires that the new instance dir and
> schema/config exist already. Is there a particular reason for this? It
> would be incredible convenient if I could create a core with a new schema
> and new config simply by calling CREATE (maybe providing the contents of
> config.xml and schema.xml as base64 encoded strings in HTTP POST or
> something?).
>
> I'm guessing this isn't currently possible?
>
> Ta,
>
>  - bram
>