Cassandra Cluster Manager (CCM) is a set of scripts that helps in creating/managing local Cassandra cluster for testing and development purpose. It’s a very handy tool that supports a lot of option and creates the cluster with one command, with no pain of updating the configuration files etc.
Let’s see how to setup a local cluster using CCM.
Once CCM is installed there are few additional things to be done if using OSX like in may case. The steps are also mentioned on CCM site
$sudo ifconfig lo0 alias 127.0.0.2 up $sudo ifconfig lo0 alias 127.0.0.3 up $sudo ifconfig lo0 alias 127.0.0.4 up
Once done, we just need to run a command to setup the cluster
$ccm create demo-cluster -v 2.1.1 -n 3 -s
demo-cluster is the name of the cluster
-v tells version of Cassandra to be used
-n tells number of nodes in the cluster, here we have used 3 nodes
Once the cluster has been setup, we can see it using status command
bash-3.2$ jps 11011 Jps 9994 CassandraDaemon 9995 CassandraDaemon 9996 CassandraDaemon bash-3.2$ ccm status Cluster: 'demo' --------------- node1: UP node3: UP node2: UP
This is how the cluster looks in Datastax OpCenter
CCM does support a lot of other features, can find more using ccm help command