>
>  3.1) rm -r data/KS-X
>  3.2) mv data/KS-Y data/KS-X

This won't work, sstable names contains keyspace name.

I had this issue too (wanted to split a keyspace into multiple ones, use
this occasion to rename tables, etc

I finally ended up writing a small python script there :
https://github.com/arodrime/cassandra-tools/blob/master/operations/move_table.py.
This was allowing me to mv any ks.cf to ks.cf2, ks2.cf2, or ks2.cf.

I used it in my previous job prod and it worked like a charm, we were
really happy with this, yet I won't assume any responsibility. Just hope it
will be useful to you.

One last warning, it was written to be compatible with my environment, you
might adjust a few things or improve the code to have anything you need as
an option. Feel free to do whatever you want with this code.

Anyway, you have the logic in there at least.

C*heers,

-----------------
Alain Rodriguez
France

The Last Pickle
http://www.thelastpickle.com

2016-01-27 15:49 GMT+01:00 Jean Tremblay <jean.tremb...@zen-innovations.com>
:

> Hi,
>
> I have a huge set of data, which takes about 2 days to bulk load on a
> Cassandra 3.0 cluster of 5 nodes. That is about 13 billion rows.
>
> Quite often I need to reload this data, new structure, or data is
> reorganise. There are clients reading from a given keyspace (KS-X).
>
> Since it takes me 2 days to load my data, I was planning to load the new
> set on a new keyspace (KS-Y), and when loaded drop KS-X and rename KS-Y to
> KS-X.
>
> Now I know "renaming keyspace" is a functionality which was removed.
>
> Would this procedure work to destroy an old keyspace KS-X and rename a new
> keyspace KS-Y to KS-X:
>
> 1) nodetool drain each node.
> 2) stop cassandra on each node.
> 3) on each node:
>         3.1) rm -r data/KS-X
>         3.2) mv data/KS-Y data/KS-X
> 4) restart each node.
>
> Could someone please confirm this? I guess it would work, but I’m just
> afraid that there could be in some system table some information that would
> not allow this.
>
> Thanks for your help.
>
> Cheers
>
> Jean

Reply via email to