You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shawn Heisey (JIRA)" <ji...@apache.org> on 2017/11/21 22:43:00 UTC

[jira] [Commented] (SOLR-11663) CLONE - API to create a core is broken

    [ https://issues.apache.org/jira/browse/SOLR-11663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16261614#comment-16261614 ] 

Shawn Heisey commented on SOLR-11663:
-------------------------------------

The CREATE action on the CoreAdmin API has never been able to work when it can't find a configuration.  CoreAdmin is *OLD*, and predates all of the slick functionality of the recent admin interfaces.  Access to it has been added to the UI, but the underlying functionality is still the same as it always was.

This requirement *is* in the documentation and has been for a while.  I'm the one who put it there.  Here's the exact text:

{noformat}
CREATE must be able to find a configuration!

Your CREATE call must be able to find a configuration, or it will not succeed.

When you are running SolrCloud and create a new core for a collection, the configuration will be inherited from the collection. Each collection is linked to a configName, which is stored in the ZooKeeper database. This satisfies the config requirement. There is something to note, though – if you’re running SolrCloud, you should NOT be using the CoreAdmin API at all. Use the Collections API.

When you are not running SolrCloud, if you have Config Sets defined, you can use the configSet parameter as documented below. If there are no config sets, then the instanceDir specified in the CREATE call must already exist, and it must contain a conf directory which in turn must contain solrconfig.xml, your schema, which is usually named either managed-schema or schema.xml, and any files referenced by those configs.

The config and schema filenames can be specified with the config and schema parameters, but these are expert options. One thing you could do to avoid creating the conf directory is use config and schema parameters that point at absolute paths, but this can lead to confusing configurations unless you fully understand what you are doing.
{noformat}


> CLONE - API to create a core is broken
> --------------------------------------
>
>                 Key: SOLR-11663
>                 URL: https://issues.apache.org/jira/browse/SOLR-11663
>             Project: Solr
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 6.6
>            Reporter: Jaya Naga Bhavana
>
> *Steps To Reproduce*
> {code}
> curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=new_core&instanceDir=new_core'
> {code}
> *Expected Result*
> Create a core called "new_core".
> *Actual Result*
> {quote}
> Error CREATEing SolrCore 'new_core': Unable to create core [new_core] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/var/solr/data/new_core/conf'
> {quote}
> Somebody on solr-users tells me:
> {quote}
> 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.
> {quote}
> Huh? Where is this magical knowledge mentioned in the [API documentation|https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API]?
> Another user on the list serve says:
> {quote}
> In fact, yes. The thing to remember here is that you're using a much
> older approach that had its roots in the pre-cloud days.
> {quote}
> *The whole point of creating APIs is to abstract out details that the caller doesn't need to know, and yet this API requires an understanding of Solr's internal file structure and history of the project?* I'm speechless.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org