1
votes

Seems to be I can't find the proper syntax for this.

Version 1.1.4 Snapshot [cqlsh 2.2.0 | Cassandra unknown | CQL spec 3.0.0 | Thrift protocol 19.32.0]

I can create a new keyspace with the following.

create keyspace something_interesting WITH strategy_class = 'NetworkTopologyStrategy' AND strategy_options:"99999" = 3 AND strategy_options:"44444" = 3 AND strategy_options:"66666" = 3;

However ALTER KEYSPACE "something_interesting" WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', "66666":1,"44444":1};

Results in a syntax error.

1

1 Answers

1
votes

I believe the issue is the double quotes on the DC names, which should be single quotes. The following command works for me, albeit on a different CQL spec (3.1.1).

ALTER KEYSPACE something_interesting WITH replication = {'class': 'NetworkTopologyStrategy', '66666':1, '44444':2};

Using double quotes gives the error:

cqlsh> ALTER KEYSPACE something_interesting WITH replication = {'class': 'NetworkTopologyStrategy', "66666":1, "44444"2};
Bad Request: line 1:104 no viable alternative at input '44444'