CQL for Cassandra 2.x

Setup to trace consistency changes

To setup five nodes on your local computer, trace reads at different consistency levels, and then compare the results.


  1. Get the ccm library of scripts from github.
    Use this library to perform the following actions:
    • Download Apache Cassandra source code.
    • Create and launch an Apache Cassandra cluster on a single computer.
    Refer to the ccm README for more options.
  2. Enter the following commands on the command line to set up the alias on the local IP.
    $ sudo ifconfig lo0 alias up
    $ sudo ifconfig lo0 alias up
    $ sudo ifconfig lo0 alias up
    $ sudo ifconfig lo0 alias up
  3. Download Apache Cassandra source code, version 2.0.6 for example, into the /.ccm/repository, and start the ccm cluster named trace_consistency.
    $ ccm create trace_consistency -v 2.0.6
    Downloading http://archive.apache.org/dist/cassandra/2.0.6/apache-cassandra-2.0.6-src.tar.gz to /var/folders/9k/ywsprd8n14s7hzb5qnztgb5h0000gn/T/ccm-lnfEFA.tar.gz (10.830MB)
      11356108  [100.00%] 
    Extracting /var/folders/9k/ywsprd8n14s7hzb5qnztgb5h0000gn/T/ccm-lnfEFA.tar.gz as version 2.0.6 ...
    Compiling Cassandra 2.0.6 ...
    Current cluster is now: trace_consistency
  4. In the /.ccm/repository/2.0.6/conf directory, inhibit the use of vnodes by opening the cassandra.yaml and setting num_tokens to 0.
    For more information about configuration, see Cassandra 2.1 cassandra.yaml file or Cassandra 2.0 cassandra.yaml file.
  5. Use the following command to update the configuration file.
    ccm updateconf
  6. Use the following commands to populate and check the cluster:
    $ ccm populate -n 5
    $ ccm start
  7. Check that the cluster is up:
    $ ccm node1 ring
    The output shows the status of all five nodes.