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
This installs Apache Cassandra:
brew install cassandra
Use this command to start Cassandra:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist
Use this command to stop Cassandra:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist
On Mavericks, Homebrew failed to move the plist file into LaunchAgents, which gives this error message:
launchctl: Couldn't stat("/Users/<user>/Library/LaunchAgents/homebrew.mxcl.cassandra.plist"): No such file or directory
To fix this just issue the following command. Then, try using the launchctl load
command again:
cp /usr/local/Cellar/cassandra/<version number>/homebrew.mxcl.cassandra.plist ~/Library/LaunchAgents/
- Properties:
/usr/local/etc/cassandra
- Logs:
/usr/local/var/log/cassandra
- Data:
/usr/local/var/lib/cassandra/data
- [Apache Cassandra] (http://cassandra.apache.org/)
- [Datastax Cassandra Documentation] (http://www.datastax.com/documentation/cassandra/2.0/cassandra/gettingStartedCassandraIntro.html)
Have fun with Cassandra!
Hello jamesaq12wsx, thasleembasha and BamdadNouri, I'm running Mohave 10.14.5 and I installed Cassandra 3.11.4 and I was facing the exact same issue that you were. Whenever I tried to run the cqlsh command I would get back the same error than you. So I tried running the command cassandra first and then I would get back: Cassandra 3.0 and later require Java 8u40 or later.
After doing my research I found that my JDK version was 6.1,(you can run the command $ ls /Library/Java/JavaVirtualMachines/) in my case was 1.6, so I went to
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and downloaded/installed the JDK 8.2.11 (I choose this version cause, when i check on System Preferences/JAVA/Update tab, my JRE version is the same 8.2.11).
So after I did that, then I went to the terminal, and initiated cqlsh and everything worked as expected, I really hope this helps.
Thanks,