3

私はcassandra1.1.9でキースペースを作成しようとしていますが、「キースペースの作成を支援する」と同じ方法で教えてくれました。

Placement_strategy='org.apache.cassandra.locator.SimpleStrategy'およびstrategy_options=[{replication_factor:2}];を使用してKEYSPACEテストキースペースを作成します。
これを試してみても、キースペースtestkeyspace
を作成します。
キースペースtestkeyspaceをplacement_strategy='org.apache.cassandra.locator.SimpleStrategy'およびstrategy_options={replication_factor:3};で更新します。


私はいつもこのエラーを受け取りました:
java.lang.IllegalArgumentException:列挙型constクラスがありませんorg.apache.cassandra.cli.CliClient $ AddKeyspaceArgument.STRATEGY_OPT:ONS

4

5 に答える 5

7

私はバージョン1.2.8を使用していますが、私のために機能した唯一の構文は次のとおりです。

create keyspace demo with replication = {'class':'SimpleStrategy', 'replication_factor':1}
于 2013-08-27T00:15:22.313 に答える
5

cassandra-cliを使用している場合、これは正しい構文です。

CREATE KEYSPACE testkeyspace
with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
and strategy_options = {replication_factor:2};
于 2013-02-01T21:38:42.997 に答える
0

私のためのこの仕事:

"CREATE KEYSPACE#{keyspace} WITHstrategy_class ='SimpleStrategy' ANDstrategy_options:replication_factor = 3"

于 2013-02-22T06:27:50.077 に答える
0
cqlsh:CREATE KEYSPACE keyspace_name 
      WITH strategy_class='SimpleStrategy' AND strategy_options:replication_factor='1';  
于 2013-10-04T10:46:50.063 に答える
0

cassandraクラスターに複数のデータセンターがあり、各データセンターに1つのコピーを保存する場合は、以下のコマンドを使用できます。

以下のコマンドはCLIインターフェース用です。

create keyspace KEY_SPACE  with placement_strategy = 'org.apache.cassandra.locator.NetworkTopologyStrategy' and strategy_options={DC1:1, DC2:1, DC3:1};
于 2014-09-26T09:06:55.653 に答える