How to create a keyspace in cassandra
I am trying to create a keypace in cassandra1.1.9 and I did the same as "help create keyspace" prompts me.
CREATE KEYSPACE testkeyspace with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options = [{replication_factor: 2}];
EVEN SAID THIS
create a testkeyspace;
update keyspace testkeyspace with strategy_location = '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
+3
source to share
5 answers
If you have multiple datacenters in a cassandra cluster and want to keep one copy in each datacenter, then you can use the following command:
Following is the command for the CLI interface:
create keyspace KEY_SPACE with placement_strategy = 'org.apache.cassandra.locator.NetworkTopologyStrategy' and strategy_options={DC1:1, DC2:1, DC3:1};
0
source to share