If you use Mac OS X as your platform for development work, then you may be interested to know how easy it is to use Apache Cassandra on the Mac. The following shows you how to download and setup Cassandra, its utilities, and also use DataStax OpsCenter, which is a browser-based, visual management and monitoring tool for Cassandra.
DataStax makes available the DataStax Community Edition, which contains the latest community version of Apache Cassandra, along with the Cassandra Query Language (CQL) utility, and a free edition of DataStax OpsCenter. To get Datastax Community Edition, go to the DataStax downloads page and select the tar downloads of both the DataStax Community Server and OpsCenter.
You can also use the curl command on Mac to directly download the files to your machine. For example, to download the DataStax Community Server, you could enter the following at terminal prompt:
curl -O http://downloads.datastax.com/community/dsc.tar.gz
The only prerequisites you’ll need for your Mac are likely installed – Java and Python (minimum 2.7):
The nice thing about the DataStax Community Edition server is that it bundles the database software and all the utilities you’ll need to start work. All you need to do is unzip the tar file (e.g. tar –xzf [filename]) in the directory of your choice and start the database via the cassandra script that’s found in the bin subdirectory of the main Cassandra directory:
With Cassandra started, you can now invoke one of the interface utilities to create objects and insert data. The CQL (Cassandra Query Language) utility is the primary interface used to interact in an ad-hoc manner with Cassandra:
You can also use the CLI (Command Line Interface) utility, which prior to CQL being introduced, was the primary interface into Cassandra:
The nodetool utility can be used to check the status of Cassandra and run other management tasks:
Installing DataStax OpsCenter on Mac involves working through the following steps in a terminal window:
tar –xzf) in the directory you want to use for OpsCenter../setup.py script../opscenter & from the bin directory../setup 127.0.0.1 127.0.0.1../opscenter-agent.
That’s it – you’ve now got Cassandra and DataStax OpsCenter installed and running on your Mac. For other software such as various application drivers and client libraries, visit the DataStax downloads page.