首页 > 解决方案 > 创建密钥空间时出现错误“无法找到复制策略类 'org.apache.cassandra.locator.simplestrategy”

问题描述

我已经安装了“Apache Cassandra 3.9.0 的 DataStax 发行版”。打开 cassandra CQL shell 后,我运行了以下命令

Create keyspace KeyspaceName
with replicaton{'class':'simplestrategy','replication_factor': 1}

但我收到一个错误:

Unable to find replication strategy class 'org.apache.cassandra.locator.simplestrategy'

标签: cassandradatastax

解决方案


复制策略类名称在 CQL 中区分大小写,复制因子为 1 的 SimpleStrategy 的正确语法是:

CREATE KEYSPACE my_keyspace
WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1}

推荐阅读