Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error "Unable to find replication strategy class 'org.apache.cassandra.locator.simplestrategy" while creating keyspace

I have installed "DataStax Distribution of Apache Cassandra 3.9.0". After opening cassandra CQL shell i ran the below command

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

But i am getting an error:

Unable to find replication strategy class 'org.apache.cassandra.locator.simplestrategy'
like image 926
Swarup Avatar asked Dec 27 '25 23:12

Swarup


2 Answers

The replication strategy class name is case sensitive in CQL, the correct syntax for a SimpleStrategy with replication factor of 1 is:

CREATE KEYSPACE my_keyspace
WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1}
like image 94
jorgebg Avatar answered Dec 31 '25 00:12

jorgebg


Cassandra is case sensitive so you should use SimpleStrategy instead of simplestrategy and no spaces in between are appreciated.

like image 38
Sivani Dwarampudi Avatar answered Dec 30 '25 22:12

Sivani Dwarampudi