Reputation: 7043
I am new to cassandra. I have created a keyspace as the following
CREATE KEYSPACE sample WITH replication = {
'class': 'SimpleStrategy',
'replication_factor': '1'
};
Now i want the properties of the keyspace to be altered so i execute the statement
alter keyspace sample with placement_strategy='org.apache.cassandra.locator.NetworkTopologyStrategy' AND stratey_options={DC1:1,DC2:0};
But i get the below error while trying to execute the statement
Bad Request: Failed parsing statement: [alter keyspace "sample" with placement_strategy='org.apache.cassandra.locator.NetworkTopologyStrategy' AND strategy_options={DC1:1,DCC2:0};] reason: NullPointerException null
Can someone please tell me the reason behind the error and the proper alter keyspace statement to make the changes to its properties?
Upvotes: 1
Views: 323
Reputation: 709
If you are using Cassandra-2.0.x then the following alter command will work for you.
ALTER KEYSPACE sample WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'DC1' : 1, 'DC2' : 0 }
I think it will work for Cassandra-1.2.16 as well.
Upvotes: 2