TLDR; use CCM instead
Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Mac OS X has a copy of Python preinstalled, but this makes sure you get the newest version.
brew install python
To use cqlsh, the Cassandra query language shell, you need to install cql:
pip install cql
pip install cassandra-driver
This installs Apache Cassandra:
brew install cassandra
Command to start cassandra
brew services run cassandra
Command to start cassandra on start up (not necessarily desired)
brew services start cassandra
To restart or stop
brew services restart/stop cassandra
This will likely launch an annoying popup window which is solved by downloading and installing legacy java cmd line tools
https://support.apple.com/kb/dl1572?locale=en_US
Properties: /usr/local/etc/cassandra
Logs: /usr/local/var/log/cassandra
Data: /usr/local/var/lib/cassandra/data
$> cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.2 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh>
If like me cqlsh did not start and instead errors out with error 61...
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(61, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
It's likely to be a java related error so check out the installed java version
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
The simplest fix for me was to update to: JDK 8u172
A few notes to self:
Don't bother with oracle website just use homebrew
brew tap caskroom/versions
brew search java
brew cask install java8
set $JAVA_HOME in ~/.zshrc or if using bash ~/.profile etc etc
JAVA_HOME=/Library/Java/Home
trouble shoot just starting cassandra by checking the version
cassandra -v
Even though cassandra 3.11.2 is supposed to work with java 9.0+, it did not work for me and any version of Java8 worked fine after the correct osx specific JAVA_HOME was set.