How do you rename a live Cassandra keyspace through the cassandra-cli? Previous versions had an option in cassandra-cli ("rename keyspace"). However, that option has been dropped in recent releases.
Keyspace Name: Keyspace name cannot be altered in Cassandra. Strategy Name: Strategy name can be altered by using a new strategy name. Replication Factor: Replication factor can be altered by using a new replication factor.
If you want to change the replication factor of a keyspace, you can do it by executing the ALTER KEYSPACE command, which has the following syntax: Syntax: ALTER KEYSPACE "KeySpace Name" WITH replication = {'class': 'Strategy name', 'replication_factor' : 'No. Of replicas'};
The main purpose of RENAME is to change the names of CQL-generated primary key and column names that are missing from a legacy table. The following restrictions apply to the RENAME operation: You can only rename clustering columns, which are part of the primary key. You cannot rename the partition key.
Renaming keyspaces (and column families) is no longer supported, since it was prone to race conditions. See https://issues.apache.org/jira/browse/CASSANDRA-1585.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With