Tuesday, June 4, 2013

Configure Apache Cassandra (Mac OS X)

Apache Cassandra Configuration Steps for Mac OS X:

1. Download And Install Apache Cassandra :
  • Download Apache Cassandra : http://cassandra.apache.org/download/
  • Now check weather JAVA_HOME and PATH environment variables has been set or not, if not then put this command in terminal 
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"
export PATH="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin:$PATH"
  • You also need to create three folders under /var/lib/cassandra/ folder for data, commit logs and saved caches, as follows.
  • Now start up Cassandra by invoking {cassandrafolderpath}$ bin/cassandra -f  from the command line.
  • Assuming you don't see messages with scary words like "error", or "fatal", or anything that looks like a Java stack trace, then everything should be working.
  • Press "Control-C" to stop Cassandra.

2. Apache Cassandra CLI :

Cassandra ships with a very basic interactive command line interface. Using the CLI you can connect to remote nodes in the cluster to create or update your schema and set and retrieve records.

You can start the CLI using the {cassandrafolderpath}$ bin/cassandra -cli. If you are evaluating a local cassandra node then be sure that it has been correctly configured and successfully started before starting the CLI.
If successful you will see output similar to this :

Welcome to cassandra CLI.
Type 'help;' or '?' for help. Type 'quit;' or 'exit;' to quit.

3. Admin Console for Cassandra GUI :
  • Download WSO2 Cassandra GUI : https://app.box.com/s/opl2zn5dvzu271rfqn2a
  • Extract the downloaded product and lets refer extracted folder as WSO_HOME. go to WSO_HOME/bin and run ./wso2server.sh.
  • Log in to the admin console from browser using.
Default username/password = admin/admin
  • Click connect to cluster on right hand side panel. Give connection URL and credentials (if there is any) to connect. 
eg: URL = localhost:9160,  or (No username/password by default)
  • After a Successful connection you will be directed to keyspace listing page. Which will include Keyspaces and clickable column family names. Click on a Column Family to Explore data.
  • Row view Page. After clicking the column family you have landed in the row view page. It includes rows of your column family and a slice of column data as a summary. 
  • You can search, paginate or change no of items to filter your data. Click "view more" to explore a single row.
  • Column family view page will list all the columns in a single row. You can filter the data with column name,value or time stamp. full numbered pagination is available.
  • Done !

References :



  1. Hi,

    I have just completed configuration. Thanks to your blog. I am beginner and would like to know how cassandra works. I read many blogs and pages, but not getting much idea. Can you explain me stuff in simple terms.

    1. Hi Hiten,

      When i started to learn cassandra was confused with too much data available on net but was not latest that's why i wrote this blog.
      I've also made some sample application but i like this demo https://github.com/itstarting/jtwissandra to be useful. i've gone through the code and understand each and every step. I think you should also gone through with this code.
      Let me know about your progress.

  2. hi...Im student from Informatics engineering nice article,
    thanks for sharing :)