manoj.sharma99765_192577 avatar image
manoj.sharma99765_192577 asked Erick Ramirez answered

Is it possible to clone a table which has Solr indexes to another cluster without indexing again?

There are 2 cluster of Cassandra Test1 & Test2(both has same version & config). Need to backup keyspace present on solr enable node of test1 cluster and restore same to solr enable node of Test2 cluster. Post restoring keyspace we need to create core & perform indexing again is there any way to avoid re indexing post restoration please let us know what files should we copy from test1 cluster to test2 cluster to achieve same.

[EDIT] I have tried following

1) Created keyspace ks1 on test2 cluster on node using schema of ks on test1 node 2 then Copied keyspace data from test1 cluster node 2 datafolder: /var/lib/cassandra/data/ks1/*

2) also copied to test 2 node

3)restarted service post this activity

4) ks working fine able to query data

5) but cores are not there in solr which were created for ks on node 1(test1) checked logs there was error unable to initialize core as resources schema.xml & are not present did you missed to upload it ? Please let me know from which folder i can copy this resources from node(test1)) and keep in test2 so that i can avoid skip core creation and reindexing again on test2 cluster for ks keyspace.

I havent used sstableloder copied data directly using scp and saved in destination ks data directory .

Dse Version : 5.0.7

Alao let me know if it is must to perform reindexing post restoring backup of dse search node on another search node.

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

bettina.swynnerton avatar image
bettina.swynnerton answered

Hi @manoj.sharma99765_192577,

you write that both clusters have the same version and configuration.

If you want to clone a keyspace by copying the snapshot files, you will also need to have the exact same token layout as the original cluster. If both clusters are already set up, it is unlikely that this is the case.

However, if you have the exact same token layout, you can copy both the sstables and the solr data. You will find the solr data relevant to your keyspace in your directory, organized by <keyspace>.<table> name. The default location for the is /var/lib/cassandra/data/

For the solr data backup steps, see here.

If the tokens are different, you can load your sstables with sstableloader, but then you will need to reindex the data to get the matching solr index per node.

I am not sure what version you are on, but here is some documentation for Cassandra 3.x:

This one has the information about how to retrieve the list of tokens and how to set them up in the new cluster:

I hope this answers your question, let us know.

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered

It isn't possible to restore the Solr indexes in the way that you're proposing. You must create the Solr core on the new cluster. If you create the Solr core after you've re-created the CQL table but before you clone the keyspace, DSE Search will automatically index the data you loaded.

It is not possible to restore the indexes from another node or another cluster. If you think about it, the SSTable files on disk will not be identical between the source node(s) and new node(s) so indexes from the source don't contain valid data when copied to the new node(s). Cheers!

10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.