O'Reilly logo

Learning Cassandra for Administrators by Vijay Parthasarathy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Create a keyspace

To create a keyspace, we should log in to the CQL shell. It can be found inside the bin directory. Help create keyspace on the CQL shell provides self-explanatory help on creating the keyspace:

CREATE KEYSPACE<ksname> WITH replication = {'class':'<strategy>'[,'<option>':<val>]};

The CREATE KEYSPACE statement creates a new top-level namespace (also known as a keyspace). Valid names are any strings constructed of alphanumeric characters and underscores. Names that do not work as valid identifiers or integers should be quoted as string literals. Properties such as replication_factor and datacenters to replicate are specified during creation as the key-value pairs in the replication map. 'class' (required) is the name of the replication ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required