如何在cassandra1.1.9中创建键空间

gab*_*bby 3 cql cassandra

我正在尝试在cassandra1.1.9中创建密钥空间,并且我以"帮助创建密钥空间"的方式告诉我.

使用placement_strategy ='org.apache.cassandra.locator.SimpleStrategy'和strategy_options = [{replication_factor:2}]创建KEYSPACE testkeyspace;
即便尝试,
创建keypace testkeyspace;
使用placement_strategy ='org.apache.cassandra.locator.SimpleStrategy'和strategy_options = {replication_factor:3}更新keyspace testkeyspace;


我总是遇到这个错误:
java.lang.IllegalArgumentException:没有枚举const类org.apache.cassandra.cli.CliClient $ AddKeyspaceArgument.STRATEGY_OPT:ONS

Zac*_*ack 7

我在1.2.8版本,但唯一适用于我的语法是:

create keyspace demo with replication = {'class':'SimpleStrategy', 'replication_factor':1}
Run Code Online (Sandbox Code Playgroud)


Sch*_*jer 5

如果您使用的是cassandra-cli,这是正确的语法:

CREATE KEYSPACE testkeyspace
with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
and strategy_options = {replication_factor:2};
Run Code Online (Sandbox Code Playgroud)