Create Keyspace in Cassandra
All tables are grouped in keyspace. Keyspace name should be
comprised of only alphanumeric characters and cannot be empty. KEYSPACE are
limited in size to 48 characters.
Syntax:- CREATE KEYSPACE [ IF NOT EXISTS ] keyspace_name WITH options
The supported options are
Name
|
Type
|
Mandatory
|
Default
|
Description
|
replication
|
map
|
yes
|
The replication
strategy and options to use for the keyspace.
|
|
durable_writes
|
simple
|
no
|
TRUE
|
Whether to use
the commit log for updates on this keyspace.
|
cqlsh> CREATE KEYSPACE Customer WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 3};
cqlsh> CREATE KEYSPACE Music WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1' : 1, 'DC2' : 3} AND durable_writes = false;
No comments:
Post a Comment
Note: only a member of this blog may post a comment.