Changing keyspace strategy
Changing the strategy of a keyspace from SimpleStrategy to NetworkTopologyStrategy.
A keyspace is created with a strategy. For development work, the
SimpleStrategy class is acceptable. For production work, the
NetworkTopologyStrategy class must be set. To change the
strategy, two steps are required.
Procedure
- Change the snitch to a network-aware setting.
-
Alter the keyspace properties using the
ALTER KEYSPACEcommand. For example, the keyspace cycling set toSimpleStrategyis switched toNetworkTopologyStrategy.cqlsh> ALTER KEYSPACE cycling WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'DC1' : 3, 'DC2' : 2 };
