Illustration Image

Cassandra.Link

The best knowledge base on Apache Cassandra®

Helping platform leaders, architects, engineers, and operators build scalable real time data platforms.

8/9/2021

Reading time:2 min

Cassandra on MacOS

by John Doe

These are my notes on getting Cassandra going on macOS. Took me a while to figure it all out, so I’m documenting them here for when I need to do it again.These notes are correct as of November 4, 2017, but I expect that they will go stale before to long. At this moment in time: brew cask install java installs Java 9, and brew install cassandra installs Cassandra 3.11.1. But Cassandra 3.11.1 does not work with Java 9, it requires Java 8. The only option at the moment appears to downgrade to Java 8. To do this:brew updatebrew tap caskroom/versionsbrew cask uninstall javabrew cask install java8brew install cassandrabrew services start cassandraWith Cassandra installed, my next task was to get a GUI for Cassandra so I could easily look at what my CQL was doing. DBeaver seems most highly recommended, but the Community edition no longer supports Cassandra out of the box, and the Enterprise edition is no longer free.To get around this I needed to install the community edition, and then add an open source Cassandra driver manually. Getting DBeaver installed was easy with brew. Thankfully Zhichun Wu has a good Cassandra jdbc driver available on GitHub. Setting it up in DBeaver took a little trial and error. Just follow the steps below to get it all going.Install DBeaver community edition with brew:brew cask install dbeaver-communityDownload the cassandra jdbc driver.When first launching DBeaver, cancel setting up a connection, and say ‘No’ to creating a sample databaseFrom the ‘Database’ menu choose ‘Driver Manager’In the modal dialog click the ‘New’ buttonIn the ‘Driver Name’ field, enter ‘Cassandra’In the ‘Class Name’ field, enter ‘com.github.cassandra.jdbc.CassandraDriver’In the ‘URL Template’ field, enter ‘jdbc:c*:datastax://{host}[:{port}]/{database}’Click the ‘Add File’ button, and choose the ‘cassandra-jdbc-driver-0.6.4-shaded.jar’ downloaded previouslyClick ‘OK’ to save the Cassandra driver, and then ‘Close’ to close the ‘Driver Manager’From the ‘Database’ menu, pick ‘New Connection’Select ‘Cassandra’ from the list of database drivers and click ‘Next’Enter ‘localhost’ for the Host, ‘9042’ for the Port, ‘system’ for the Database/Schema, ‘cassandra’ for the User name, and ‘cassandra’ for the Password, then click ‘Next’Click ‘Next’ again to skip the Network config step, and then ‘Finish’ to save the connection.At this point it should work.

Illustration Image

These are my notes on getting Cassandra going on macOS. Took me a while to figure it all out, so I’m documenting them here for when I need to do it again.

These notes are correct as of November 4, 2017, but I expect that they will go stale before to long. At this moment in time: brew cask install java installs Java 9, and brew install cassandra installs Cassandra 3.11.1. But Cassandra 3.11.1 does not work with Java 9, it requires Java 8. The only option at the moment appears to downgrade to Java 8. To do this:

brew update
brew tap caskroom/versions
brew cask uninstall java
brew cask install java8
brew install cassandra
brew services start cassandra

With Cassandra installed, my next task was to get a GUI for Cassandra so I could easily look at what my CQL was doing. DBeaver seems most highly recommended, but the Community edition no longer supports Cassandra out of the box, and the Enterprise edition is no longer free.

To get around this I needed to install the community edition, and then add an open source Cassandra driver manually. Getting DBeaver installed was easy with brew. Thankfully Zhichun Wu has a good Cassandra jdbc driver available on GitHub. Setting it up in DBeaver took a little trial and error. Just follow the steps below to get it all going.

  1. Install DBeaver community edition with brew:
    brew cask install dbeaver-community
  2. Download the cassandra jdbc driver.
  3. When first launching DBeaver, cancel setting up a connection, and say ‘No’ to creating a sample database
  4. From the ‘Database’ menu choose ‘Driver Manager’
  5. In the modal dialog click the ‘New’ button
  6. In the ‘Driver Name’ field, enter ‘Cassandra’
  7. In the ‘Class Name’ field, enter ‘com.github.cassandra.jdbc.CassandraDriver’
  8. In the ‘URL Template’ field, enter ‘jdbc:c*:datastax://{host}[:{port}]/{database}’
  9. Click the ‘Add File’ button, and choose the ‘cassandra-jdbc-driver-0.6.4-shaded.jar’ downloaded previously
  10. Click ‘OK’ to save the Cassandra driver, and then ‘Close’ to close the ‘Driver Manager’
  11. From the ‘Database’ menu, pick ‘New Connection’
  12. Select ‘Cassandra’ from the list of database drivers and click ‘Next’
  13. Enter ‘localhost’ for the Host, ‘9042’ for the Port, ‘system’ for the Database/Schema, ‘cassandra’ for the User name, and ‘cassandra’ for the Password, then click ‘Next’
  14. Click ‘Next’ again to skip the Network config step, and then ‘Finish’ to save the connection.

At this point it should work.

Related Articles

cassandra
data.visualization
dbeaver

Apache Cassandra Lunch #66: Using DBeaver with Cassandra - Business Platform Team

John Doe

6/24/2022

cassandra
macos

Checkout Planet Cassandra

Claim Your Free Planet Cassandra Contributor T-shirt!

Make your contribution and score a FREE Planet Cassandra Contributor T-Shirt! 
We value our incredible Cassandra community, and we want to express our gratitude by sending an exclusive Planet Cassandra Contributor T-Shirt you can wear with pride.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company

Explore Related Topics

AllKafkaSparkScyllaSStableKubernetesApiGithubGraphQl

Explore Further

cassandra