Convert TLOG collection to NRT

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Convert TLOG collection to NRT

Dominique Bejean
Hi,

I would like to convert a collection (3 shards x 3 replicas) from TLOG to
NRT.

The only solution I imagine is something like :
* with collection API, remove replicas in order to keep only 1 replica per
3 shard
* update the collection state.json in zookeer
* with collection API, reload the collection
* with collection API, add 2 replicas per shard

Is there a simpler solution ?

Regards

Dominique
Reply | Threaded
Open this post in threaded view
|

Re: Convert TLOG collection to NRT

Shawn Heisey-2
On 12/10/2019 11:25 AM, Dominique Bejean wrote:
> I would like to convert a collection (3 shards x 3 replicas) from TLOG to
> NRT.
>
> The only solution I imagine is something like :
> * with collection API, remove replicas in order to keep only 1 replica per
> 3 shard
> * update the collection state.json in zookeer
> * with collection API, reload the collection
> * with collection API, add 2 replicas per shard

I have not actually done this, but based on my understanding of how the
collections API functions, you could just run ADDREPLICA to create a new
NRT replica on the desired host, then DELETEREPLICA to remove the TLOG
replica that it replaces.  Repeat those two steps for each one you want
to convert.  I don't think reloading would be required, but might be
something you want to do after you're all done with those operations.
If you expect copying the shard to the new replica to take longer than 3
minutes, you should do the ADDREPLICA operations as async requests.

Modifying data in zookeeper directly is an expert option, not something
you would want to do unless you've got a very deep understanding of
SolrCloud code.  It could leave your setup in a state that's difficult
to fix.

Thanks,
Shawn
Reply | Threaded
Open this post in threaded view
|

Re: Convert TLOG collection to NRT

Dominique Bejean
Thank you Shawn.
You're right !
It is better to read the good version of the Collection API documentation.


Le mar. 10 déc. 2019 à 19:49, Shawn Heisey <[hidden email]> a écrit :

> On 12/10/2019 11:25 AM, Dominique Bejean wrote:
> > I would like to convert a collection (3 shards x 3 replicas) from TLOG to
> > NRT.
> >
> > The only solution I imagine is something like :
> > * with collection API, remove replicas in order to keep only 1 replica
> per
> > 3 shard
> > * update the collection state.json in zookeer
> > * with collection API, reload the collection
> > * with collection API, add 2 replicas per shard
>
> I have not actually done this, but based on my understanding of how the
> collections API functions, you could just run ADDREPLICA to create a new
> NRT replica on the desired host, then DELETEREPLICA to remove the TLOG
> replica that it replaces.  Repeat those two steps for each one you want
> to convert.  I don't think reloading would be required, but might be
> something you want to do after you're all done with those operations.
> If you expect copying the shard to the new replica to take longer than 3
> minutes, you should do the ADDREPLICA operations as async requests.
>
> Modifying data in zookeeper directly is an expert option, not something
> you would want to do unless you've got a very deep understanding of
> SolrCloud code.  It could leave your setup in a state that's difficult
> to fix.
>
> Thanks,
> Shawn
>