Creating a demo keyspace for tutorials
Step-by-step instructions to create a keyspace for tutorials found in this section.
Procedure
-
Get a list of datacenter names (DC) in the cluster.
dsetool status
The header line contains the datacenter name (
DC: <datacenter_name>) and the type of workload.
DC: Cassandra Workload: Cassandra Graph: no ====================================================== ... DC: Solr Workload: Search Graph: no ====================================================== ...
-
Start a cqlsh session:
cqlsh
To connect cqlsh to a remote node use the host switch with the hostname or IP address. -
Create a demo keyspace with a replication factor of 1 in each datacenter.
In multi-datacenter environments use
NetworkTopologyStrategy
and set the replication factor for each datacenter to at least one.CREATE KEYSPACE demo WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'Cassandra': '1', 'Solr': '1'};
Datacenter names are case-sensitive.
Exit cqlsh and ensure that the name exactly matches the DC name from the nodetool status
output.