ConfigurationException:无法识别的策略选项{datacenter1}传递给SimpleStrategy以进行键空间循环

时间:2018-01-15 17:54:10

标签: cassandra nosql

我是Cassandra的初学者。我试过这个

cqlsh> CREATE KEYSPACE cycling
   ... WITH REPLICATION = {'class' : 'SimpleStrategy', 'datacenter1' : 1 };

但是无法识别datacenter1

ConfigurationException: Unrecognized strategy option {datacenter1} passed to SimpleStrategy for keyspace cycling

为什么?

1 个答案:

答案 0 :(得分:5)

The SimpleStrategy doesn't support that option. The correct create statement would be:

CREATE KEYSPACE cycling WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':1};

If you want to specify replication by datacenter then you need to use the NetworkTopologyStrategy, in which case the create statement would be:

CREATE KEYSPACE cycling WITH REPLICATION = {'class':'NetworkTopologyStrategy','datacenter1':1};

More information on this can be found here