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

Tommaso Teofili commented on SOLR-3425:
---------------------------------------

bq. Perhaps we should just add new collection management api?

I think so, that would also help SolrCloud users understand the mind shift from 
cores to collections.

For this particular thing the dummy fix (not tested widely but still all the 
tests pass) could be to add the following lines for filling the urlList 
variable:
{code}
    // enable automatic distributed core creation
    if (request instanceof CoreAdminRequest.Create) {
      for (String liveNodeHost : zkStateReader.getCloudState().getLiveNodes()) {
        urlList.add(new 
StringBuilder("http://";).append(liveNodeHost.replaceAll("_solr", 
"/solr/")).toString());
      }
    }
    else {
      for (Slice slice : slices.values()) {
    ...
{code}

however i don't like it very much. I think adding proper APIs would be just 
better.
                
> CloudSolrServer can't create cores when using the zkHost based constructor
> --------------------------------------------------------------------------
>
>                 Key: SOLR-3425
>                 URL: https://issues.apache.org/jira/browse/SOLR-3425
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrCloud
>            Reporter: Tommaso Teofili
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: SOLR-3425-test.patch
>
>
> When programmatically creating cores with a running SolrCloud instance the 
> CloudSolrServer uses the slices nodes information to feed the underlying 
> LBHttpSolrServer so it fails to create cores as there aren't any slices for 
> any new collection (as it's still to be created).
> This happens when using the CloudSolrServer constructor which takes the ZK 
> host as only parameter while it can be avoided by using the constructor which 
> also takes the list of Solr URLs and the underlying LBHttpSolrServer is 
> actually used for making the core creation request.
> However it'd be good to use the ZK host live nodes information to 
> automatically issue a core creation command on one of the underlying Solr 
> hosts without having to specify the full list of URLs beforehand.
> The scenario is when one wants to create a collection with N shards so the 
> client sends N core creation requests for the same collection thus the 
> SolrCloud stuff should just take care of choosing the host where to issue the 
> core creation request and update the cluster state.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to