Altering a Keyspace - Cassandra

Altering a Keyspace - Cassandra

Instructor-svgAl-Mamun Sarkar
Sep 19 , 2020

Altering Keyspace is needed when you need to update REPLICATION or DURABLE_WRITES. 

 

Alter Keyspace:

Syntax:

ALTER KEYSPACE  WITH 
ALTER KEYSPACE "KeySpace_Name"
WITH REPLICATION = {'class': "Strategy_name", 'replication_factor' : "Number of replicas"}
AND DURABLE_WRITES = true;

Example:

ALTER KEYSPACE test_keyspace 
WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': 3} 
AND DURABLE_WRITES = true;

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram