How to create a key space in cassandra1.1.9

advertisements

I am trying to create keyspace in cassandra1.1.9 and I did the same way how 'help create keyspace' tell me.

CREATE KEYSPACE testkeyspace with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options = [{replication_factor:2}];
EVEN TRIED THIS
create keyspace testkeyspace;
update keyspace testkeyspace with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options = {replication_factor:3};


I always got this error:
java.lang.IllegalArgumentException: No enum const class org.apache.cassandra.cli.CliClient$AddKeyspaceArgument.STRATEGY_OPT:ONS


If you are using cassandra-cli this is the correct syntax:

CREATE KEYSPACE testkeyspace
with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
and strategy_options = {replication_factor:2};