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 ramyogi <ra...@gmail.com> on 2019/02/11 04:38:56 UTC

COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

SOLR 7.5.0
Created collection as below:
/admin/collections?action=CREATE&name=test_collection&numShards=1&maxShardsPerNode=1&rule=replica:<2,node:*&collection.configName=test_collection_config

Created Successfully.

After that when I try to see CLUSTERSTATUS, it is  giving "replicas": {}
empty. But IN SOLR 5.3.1 it was giving the response but SOLR 7.5.0 it is
not.
Please  help out what is missing how to fix.

/solr/admin/collections?action=CLUSTERSTATUS&wt=json

{
  "responseHeader": {
    "status": 0,
    "QTime": 1
  },
  "cluster": {
    "collections": {
      "test_collection": {
        "pullReplicas": "0",
        "replicationFactor": "1",
        "shards": {
          "shard1": {
            "range": "80000000-7fffffff",
            "state": "active",
            "replicas": {}
          }
        },
        "router": {
          "name": "compositeId"
        },
        "maxShardsPerNode": "1",
        "autoAddReplicas": "false",
        "nrtReplicas": "1",
        "tlogReplicas": "0",
        "rule": [
          {
            "replica": "<2",
            "node": "*"
          }
        ],
        "znodeVersion": 6,
        "configName": "test_collection_config"
      }



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

Posted by ramyogi <ra...@gmail.com>.
Thanks a lot Erick, Shawn and Walter. As Shawn mentioned I should not use
core admin API when in solrcloud, Just reloading collection solved the
problem. 



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

Posted by Walter Underwood <wu...@wunderwood.org>.
Core admin is required for REQUESTRECOVERY. Otherwise, I agree, don’t use it.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Apr 28, 2019, at 4:14 PM, Erick Erickson <er...@gmail.com> wrote:
> 
> What Shawn said. Stop using the core admin API. It will not register the core with ZooKeeper. legacyCloud=true may put the info in ZooKeeper, but usually puts it in clusterstate.json rather than the proper place, collections>>your_collection>>state.json. There’s no guarantee whatsoever that legacyCloud will be supported in any fashion whatsoever in the future.
> 
> No, more strongly than that. There is a _guarantee_ that legacyCloud will _not_ be supported in the future, it’s just a matter of when.
> 
> You are using unsupported functionality and are on your own.
> 
> The collections API is here: https://lucene.apache.org/solr/guide/7_3/collections-api.html
> 
> Best,
> Erick
> 
>> On Apr 28, 2019, at 10:02 AM, Shawn Heisey <ap...@elyograg.org> wrote:
>> 
>> On 4/28/2019 6:39 AM, ramyogi wrote:
>>> Thanks Eric, After we create a collection and copy the index from one place
>>> new place, we are doing UNLOAD core and CREATE core as below, is it wrong
>>> and we have alternative to do that ?
>> 
>> Do not use CoreAdmin when running SolrCloud.  At all.  It will cause you problems.  All actions in SolrCloud need to happen through the Collections API.
>> 
>> After you copy the index into place, simply reload the collection.  Use the Collections API, not CoreAdmin.
>> 
>> https://lucene.apache.org/solr/guide/7_7/collections-api.html#reload
>> 
>> Thanks,
>> Shawn
> 


Re: COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

Posted by Erick Erickson <er...@gmail.com>.
What Shawn said. Stop using the core admin API. It will not register the core with ZooKeeper. legacyCloud=true may put the info in ZooKeeper, but usually puts it in clusterstate.json rather than the proper place, collections>>your_collection>>state.json. There’s no guarantee whatsoever that legacyCloud will be supported in any fashion whatsoever in the future.

No, more strongly than that. There is a _guarantee_ that legacyCloud will _not_ be supported in the future, it’s just a matter of when.

You are using unsupported functionality and are on your own.

The collections API is here: https://lucene.apache.org/solr/guide/7_3/collections-api.html

Best,
Erick

> On Apr 28, 2019, at 10:02 AM, Shawn Heisey <ap...@elyograg.org> wrote:
> 
> On 4/28/2019 6:39 AM, ramyogi wrote:
>> Thanks Eric, After we create a collection and copy the index from one place
>> new place, we are doing UNLOAD core and CREATE core as below, is it wrong
>> and we have alternative to do that ?
> 
> Do not use CoreAdmin when running SolrCloud.  At all.  It will cause you problems.  All actions in SolrCloud need to happen through the Collections API.
> 
> After you copy the index into place, simply reload the collection.  Use the Collections API, not CoreAdmin.
> 
> https://lucene.apache.org/solr/guide/7_7/collections-api.html#reload
> 
> Thanks,
> Shawn


Re: COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

Posted by Shawn Heisey <ap...@elyograg.org>.
On 4/28/2019 6:39 AM, ramyogi wrote:
> Thanks Eric, After we create a collection and copy the index from one place
> new place, we are doing UNLOAD core and CREATE core as below, is it wrong
> and we have alternative to do that ?

Do not use CoreAdmin when running SolrCloud.  At all.  It will cause you 
problems.  All actions in SolrCloud need to happen through the 
Collections API.

After you copy the index into place, simply reload the collection.  Use 
the Collections API, not CoreAdmin.

https://lucene.apache.org/solr/guide/7_7/collections-api.html#reload

Thanks,
Shawn

Re: COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

Posted by ramyogi <ra...@gmail.com>.
Thanks Eric, After we create a collection and copy the index from one place
new place, we are doing UNLOAD core and CREATE core as below, is it wrong
and we have alternative to do that ?

    r = requests.get('{}/admin/cores'.format(base_url), params={
        'action': 'UNLOAD',
        'core': core_name
    })
    r.raise_for_status()
    time.sleep(10)
    r = requests.get('{}/admin/cores'.format(base_url), params={
        'action': 'CREATE',
        'name': core_name,
        'shard': shard_name,
        'collection': collection_name,
        'collection.configName': config_name
    })
    r.raise_for_status()

this is why legacyCloud=false is not supporting ?



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

Posted by Erick Erickson <er...@gmail.com>.
There’s some documentation in the ref guide, did you see it?

Basically, if a replica is discovered by a solr instance by finding a “core.properties” file under SOLR_HOME, legacyCloud=true will try to reconstruct the ZooKeeper entry if it’s not there. This lead to lots of issues, and so it has been deprecated and should not be enabled.

It should not affect collection _creation_ unless you’re manually creating directories under SOLR_HOME and/or using the core (NOT collection) admin API to create replicas, which you also should not do. IOW, the collection admin API CREATE should not be sensitive at all to this setting.

Use the collections ADDREPLICA API to add replicas and you should be set. You can even create a collection with the special EMPTY nodeset that will allow you to precisely place each and every replica where you want it.

Best,
Erick

> On Apr 24, 2019, at 9:29 AM, ramyogi <ra...@gmail.com> wrote:
> 
> What is legacyCloud properties does. Is there a document I could refer. Why
> it impacts collection creation with rule based and index copy from one to
> another. Replicas not registered how to fix without legacyCloud=true
> settings.
> 
> 
> 
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

Posted by ramyogi <ra...@gmail.com>.
What is legacyCloud properties does. Is there a document I could refer. Why
it impacts collection creation with rule based and index copy from one to
another. Replicas not registered how to fix without legacyCloud=true
settings.



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

Posted by Hendrik Haddorp <he...@gmx.net>.
Do you have something about legacyCloud in your CLUSTERSTATUS response? 
I have "properties":{"legacyCloud":"false"}
In the legacy cloud mode, also calles format 1, the state is stored in a 
central clusterstate.js node in ZK, which does not scale well. In the 
modern mode every collection has its own state.json node in ZK. I guess 
there is something mixed up on your system. I would make sure to not use 
the legacy mode.

On 11.02.2019 05:57, ramyogi wrote:
> I found the reason,
> &legacyCloud=true when I create a collection with this parameter I could
> find that replicas data in CLUSTERSTATUS api request,. is there anything
> wrong if I use this in SOLR 7.5.0 when create a collection ?
> Please advice.
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: COLLECTION CREATE and CLUSTERSTATUS changes in SOLR 7.5.0

Posted by ramyogi <ra...@gmail.com>.
I found the reason,
&legacyCloud=true when I create a collection with this parameter I could
find that replicas data in CLUSTERSTATUS api request,. is there anything
wrong if I use this in SOLR 7.5.0 when create a collection ?
Please advice.



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html