lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <>
Subject Re: How to create a core by API?
Date Thu, 26 Mar 2015 16:52:27 GMT
On 3/26/2015 10:24 AM, Mark E. Haase wrote:
> I can't get the Core Admin API to work. I have a brand new installation of
> Solr 5.0.0 (in non-cloud mode). I installed using the installation script
> (a nice addition!) with default options, so I have Solr in /opt/solr and
> its data in /var/solr.
> Here's what I'm trying:
>     curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=new_core
> '
> But I get this error:
>     Error CREATEing SolrCore 'new_core': Unable to create core [new_core]
> Caused by: Can't find resource 'solrconfig.xml' in classpath or

The error message tells you what is wrong.

The CoreAdmin API requires that the instanceDir already exist, with a
conf directory inside it that contains solrconfig.xml, schema.xml, and
any other necessary config files.

If you want completely from-scratch creation without any existing
filesystem layout, you will need to run SolrCloud, which keeps config
files in the zookeeper database.  At that point you would be using the
Collections API.

If you go to Core Admin in the admin UI and click the "Add Core" button,
you will see the following note:

|instanceDir| and |dataDir| need to exist before you can create the core

This message is not quite accurate -- the dataDir (defaulting to
${instanceDir}/data) will be created if it does not already exist, and
the user running Solr has the required permissions to create it.  The
message also doesn't say anything about the conf directory or the two
required XML files.


View raw message