Creating a demo keyspace for tutorials

Step-by-step instructions to create a keyspace for tutorials found in this section.

Step-by-step instructions to create a keyspace for tutorials found in this section.

Procedure

  1. 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
    ======================================================
    ...
  2. Start a cqlsh session:
    cqlsh
    Tip: To connect cqlsh to a remote node use the host switch with the hostname or IP address.
  3. 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'};
    Note: Datacenter names are case-sensitive. Exit cqlsh and ensure that the name exactly matches the DC name from the dsetool status output.