Installing Cassandra on Mac

Diving into Cassandra and, as always, the first step is getting a local stack built. I’ve grown incredibly fond of homebrew, and so here is the one step process:
brew install cassandra

Viola, installed. The response when finished gives additional guidance:

If you plan to use the CQL shell (cqlsh), you will need the Python CQL library installed. Since Homebrew prefers using pip for Python packages, you can install that using:

pip install cql

To have launchd start cassandra at login:
ln -sfv /usr/local/opt/cassandra/*.plist ~/Library/LaunchAgents
Then to load cassandra now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist

I would recommend doing an ls on your ~/Library/LaunchAgents directory to confirm the .plist for Cassandra is present. If it is not (as mine was not), you can copy it there from the installation directory:
cp /usr/local/Cellar/cassandra/2.0.7/homebrew.mxcl.cassandra.plist ~/Library/LaunchAgents/

CQL

As the response describes, to install CQL, you would execute pip install cql. If you don’t have pip installed, you have two options to install it:

  • If you already have python installed: sudo easy_install pip
  • If you do not have python installed: brew install python

Once installed, you can start the cql shell with cqlsh, and test by running this query:
SELECT * FROM system.schema_keyspaces;